Remove the annoying qWarning when QUrl::setPort is out of range
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 20 Sep 2012 13:46:41 +0000 (15:46 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 2 Oct 2012 20:34:42 +0000 (22:34 +0200)
That's what we have QUrl::errorString() for. This will become evident
especially now that QUrl::toString() / toEncoded() return empty if
there are errors.

Change-Id: I64a84e9c6ee57c0fc38cc0c58f5286ddc1248d1f
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: David Faure <faure@kde.org>
src/corelib/io/qurl.cpp
tests/auto/corelib/io/qurl/tst_qurl.cpp

index 3c82a26..e78d810 100644 (file)
@@ -2105,7 +2105,6 @@ void QUrl::setPort(int port)
     detach();
 
     if (port < -1 || port > 65535) {
-        qWarning("QUrl::setPort: Out of range");
         port = -1;
         d->sectionHasError |= QUrlPrivate::Port;
         d->errorCode = QUrlPrivate::InvalidPortError;
index c1fb6f7..03bc64e 100644 (file)
@@ -183,11 +183,9 @@ void tst_QUrl::getSetCheck()
     obj1.setPort(0);
     QCOMPARE(0, obj1.port());
 
-    QTest::ignoreMessage(QtWarningMsg, "QUrl::setPort: Out of range");
     obj1.setPort(INT_MIN);
     QCOMPARE(-1, obj1.port()); // Out of range, -1
 
-    QTest::ignoreMessage(QtWarningMsg, "QUrl::setPort: Out of range");
     obj1.setPort(INT_MAX);
     QCOMPARE(-1, obj1.port()); // Out of range, -1
 
@@ -2443,7 +2441,6 @@ void tst_QUrl::setPort()
         QCOMPARE(url.port(), -1);
         QCOMPARE(url.toString(), QString());
         url.setPort(80);
-        QTest::ignoreMessage(QtWarningMsg, "QUrl::setPort: Out of range");
         url.setPort(65536);
         QCOMPARE(url.port(), -1);
         QVERIFY(url.errorString().contains("out of range"));