summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-09-19 14:28:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 22:34:42 +0200
commit7d62f8ace542e04e3ddf92eec4fdad8d34ac9585 (patch)
tree525c7a6285cfdfd322a9ec5672b281455dfc0183 /src/corelib/io/qurl_p.h
parenta0af0fbcd4a41fb7be6abf558296682182cdffa0 (diff)
Add two compound URL invalidity cases for isValid()
These two errors can only happen if one calls setPath() explicitly. They cannot happen for parsed URLs, which is why they are only caught with isValid(). It's not possible to set the error condition in setPath() either because they depend on the presence / absence of the authority and scheme. Also update all the unit tests that set a path not starting with a slash and were just "freeloaders" on the previous behaviour. Change-Id: Ice58cd4589a850452d7573a5b19667bbab2fb43e Reviewed-by: David Faure <faure@kde.org>
Diffstat (limited to 'src/corelib/io/qurl_p.h')
-rw-r--r--src/corelib/io/qurl_p.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h
index c696709c9c..8c1e307521 100644
--- a/src/corelib/io/qurl_p.h
+++ b/src/corelib/io/qurl_p.h
@@ -95,12 +95,16 @@ public:
PortEmptyError,
InvalidPathError = Path << 8,
- PathContainsColonBeforeSlash,
InvalidQueryError = Query << 8,
InvalidFragmentError = Fragment << 8,
+ // the following two cases are only possible in combination
+ // with presence/absence of the authority and scheme. See validityError().
+ AuthorityPresentAndPathIsRelative = Authority << 8 | Path << 8 | 0x10000,
+ RelativeUrlPathContainsColonBeforeSlash = Scheme << 8 | Authority << 8 | Path << 8 | 0x10000,
+
NoError = 0
};
@@ -110,6 +114,7 @@ public:
void parse(const QString &url, QUrl::ParsingMode parsingMode);
bool isEmpty() const
{ return sectionIsPresent == 0 && port == -1 && path.isEmpty(); }
+ ErrorCode validityError() const;
// no QString scheme() const;
void appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const;