diff options
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r-- | src/corelib/io/qurl.cpp | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 7ff23d931c..c71bb3afac 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -333,11 +333,6 @@ static inline QString ftpScheme() return QStringLiteral("ftp"); } -static inline QString httpScheme() -{ - return QStringLiteral("http"); -} - static inline QString fileScheme() { return QStringLiteral("file"); @@ -660,7 +655,7 @@ static const ushort encodedFragmentActions[] = { encode(']'), // 6 0 }; -static const ushort * const decodedFragmentInUrlActions = 0; +//static const ushort * const decodedFragmentInUrlActions = 0; static const ushort * const decodedFragmentInIsolationActions = 0; // the query is handled specially: the decodedQueryXXX tables are run with @@ -3765,6 +3760,37 @@ QString QUrl::errorString() const } /*! + \since 5.1 + + Converts a list of \a urls into a list of QStrings, using toString(\a options). +*/ +QStringList QUrl::toStringList(const QList<QUrl> &urls, FormattingOptions options) +{ + QStringList lst; + lst.reserve(urls.size()); + foreach (const QUrl &url, urls) + lst.append(url.toString(options)); + return lst; + +} + +/*! + \since 5.1 + + Converts a list of strings representing \a urls into a list of urls, using QUrl(str, \a mode). + Note that this means all strings must be urls, not for instance local paths. +*/ +QList<QUrl> QUrl::fromStringList(const QStringList &urls, ParsingMode mode) +{ + QList<QUrl> lst; + lst.reserve(urls.size()); + foreach (const QString &str, urls) { + lst.append(QUrl(str, mode)); + } + return lst; +} + +/*! \typedef QUrl::DataPtr \internal */ |