From 66df11f4d109ca3d97fed8985d6bbc6dcf90733d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 28 Mar 2012 19:31:45 -0300 Subject: Fix QUrl operator== and operator< Don't crash when either side is null but not both sides. Also make sure operator< is working properly and satisfies the basic conditions of a type (such as that if A < B, then !(B < A)). Change-Id: Idd9e9fc593e1a7781d9f4f2b13a1024b643926fd Reviewed-by: Giuseppe D'Angelo Reviewed-by: Lars Knoll --- src/corelib/io/qurl_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/io/qurl_p.h') diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h index fb54d74260..2333809c12 100644 --- a/src/corelib/io/qurl_p.h +++ b/src/corelib/io/qurl_p.h @@ -107,6 +107,8 @@ public: void parse(const QString &url, QUrl::ParsingMode parsingMode); void clear(); + bool isEmpty() const + { return sectionIsPresent == 0 && port == -1 && path.isEmpty(); } // no QString scheme() const; void appendAuthority(QString &appendTo, QUrl::FormattingOptions options) const; -- cgit v1.2.3