summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/phonon/musicplayer/mainwindow.cpp2
-rw-r--r--src/corelib/io/qurl.cpp23
-rw-r--r--src/corelib/io/qurl.h5
3 files changed, 29 insertions, 1 deletions
diff --git a/examples/phonon/musicplayer/mainwindow.cpp b/examples/phonon/musicplayer/mainwindow.cpp
index 7403e33..a20d05f 100644
--- a/examples/phonon/musicplayer/mainwindow.cpp
+++ b/examples/phonon/musicplayer/mainwindow.cpp
@@ -184,7 +184,7 @@ void MainWindow::metaStateChanged(Phonon::State newState, Phonon::State /* oldSt
QMessageBox::warning(this, tr("Error opening files"),
metaInformationResolver->errorString());
while (!sources.isEmpty() &&
- !(sources.takeLast() == metaInformationResolver->currentSource()));
+ !(sources.takeLast() == metaInformationResolver->currentSource())) /* loop */;
return;
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 77df601..423f5e2 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -4024,6 +4024,29 @@ QString QUrlPrivate::createErrorString()
}
/*!
+ \macro QT_NO_URL_CAST_FROM_STRING
+ \relates QUrl
+
+ Disables automatic conversions from QString (or char *) to QUrl.
+
+ Compiling your code with this define is useful when you have a lot of
+ code that uses QString for file names and you wish to convert it to
+ use QUrl for network transparency. In any code that uses QUrl, it can
+ help avoid missing QUrl::resolved() calls, and other misuses of
+ QString to QUrl conversions.
+
+ \oldcode
+ url = filename; // probably not what you want
+ \newcode
+ url = QUrl::fromLocalFile(filename);
+ url = baseurl.resolved(QUrl(filename));
+ \endcode
+
+ \sa QT_NO_CAST_FROM_ASCII
+*/
+
+
+/*!
Constructs a URL by parsing \a url. \a url is assumed to be in human
readable representation, with no percent encoding. QUrl will automatically
percent encode all characters that are not allowed in a URL.
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index febaf4a..65da5bf 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -81,12 +81,17 @@ public:
Q_DECLARE_FLAGS(FormattingOptions, FormattingOption)
QUrl();
+#ifdef QT_NO_URL_CAST_FROM_STRING
+ explicit
+#endif
QUrl(const QString &url);
QUrl(const QString &url, ParsingMode mode);
// ### Qt 5: merge the two constructors, with mode = TolerantMode
QUrl(const QUrl &copy);
QUrl &operator =(const QUrl &copy);
+#ifndef QT_NO_URL_CAST_FROM_STRING
QUrl &operator =(const QString &url);
+#endif
~QUrl();
void setUrl(const QString &url);