diff options
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qurl.cpp | 27 | ||||
-rw-r--r-- | src/corelib/io/qurl.h | 1 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index ecd154b113..183e5706fa 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5679,9 +5679,8 @@ static QString toPrettyPercentEncoding(const QString &input, bool forFragment) } /*! - Returns the human-displayable string representation of the - URL. The output can be customized by passing flags with \a - options. + Returns a string representation of the URL. + The output can be customized by passing flags with \a options. The resulting QString can be passed back to a QUrl later on. @@ -5734,9 +5733,8 @@ QString QUrl::toString(FormattingOptions options) const } /*! - Returns the human-displayable string representation of the - URL. The output can be customized by passing flags with \a - options. + Returns a string representation of the URL. + The output can be customized by passing flags with \a options. The resulting QString can be passed back to a QUrl later on. @@ -5750,6 +5748,23 @@ QString QUrl::url(FormattingOptions options) const } /*! + Returns a human-displayable string representation of the URL. + The output can be customized by passing flags with \a options. + The option RemovePassword is always enabled, since passwords + should never be shown back to users. + + The resulting QString can be passed back to a QUrl later on, + but any password that was present initially will be lost. + + \sa FormattingOptions, toEncoded(), toString() +*/ + +QString QUrl::toDisplayString(FormattingOptions options) const +{ + return toString(options | RemovePassword); +} + +/*! Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returned. The output can be customized by passing flags with \a options. diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 1c3390bc3d..3e5c62cd7c 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -102,6 +102,7 @@ public: void setUrl(const QString &url, ParsingMode mode = TolerantMode); QString url(FormattingOptions options = None) const; QString toString(FormattingOptions options = None) const; + QString toDisplayString(FormattingOptions options = None) const; bool isValid() const; |