summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Thomschütz <jesper@trolltech.com>2009-05-14 13:48:31 (GMT)
committerJesper Thomschütz <jesper@trolltech.com>2009-05-14 13:55:14 (GMT)
commit8e9b041f0081cd5af67c5c5f3cee0cf2b70ffe11 (patch)
treefeed93dc8771667dd2f9ef73fd18c53426e50f17
parentf09304d46bac91f3e8329cb7147f8df44898d1e0 (diff)
downloadQt-8e9b041f0081cd5af67c5c5f3cee0cf2b70ffe11.zip
Qt-8e9b041f0081cd5af67c5c5f3cee0cf2b70ffe11.tar.gz
Qt-8e9b041f0081cd5af67c5c5f3cee0cf2b70ffe11.tar.bz2
Use isNull() for strings instead of comparing against QString().
foo == QString() should be foo.isNull(). Fixes 7 warnings in the Norwegian Breakfast Network Reviewed-by: Samuel
-rw-r--r--qmake/generators/xmloutput.cpp2
-rw-r--r--src/corelib/concurrent/qfuturewatcher.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--tools/macdeployqt/shared/shared.cpp4
-rw-r--r--tools/porting/src/portingrules.cpp2
5 files changed, 7 insertions, 7 deletions
diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp
index 68d22e1..d77dd4b 100644
--- a/qmake/generators/xmloutput.cpp
+++ b/qmake/generators/xmloutput.cpp
@@ -277,7 +277,7 @@ void XmlOutput::closeTag()
void XmlOutput::closeTo(const QString &tag)
{
bool cont = true;
- if (!tagStack.contains(tag) && tag != QString()) {
+ if (!tagStack.contains(tag) && !tag.isNull()) {
//warn_msg(WarnLogic, "<%s>: Cannot close to tag <%s>, not on stack", tagStack.last().latin1(), tag.latin1());
qDebug("<%s>: Cannot close to tag <%s>, not on stack", tagStack.last().toLatin1().constData(), tag.toLatin1().constData());
return;
diff --git a/src/corelib/concurrent/qfuturewatcher.cpp b/src/corelib/concurrent/qfuturewatcher.cpp
index ea35e9e..39d7698 100644
--- a/src/corelib/concurrent/qfuturewatcher.cpp
+++ b/src/corelib/concurrent/qfuturewatcher.cpp
@@ -465,7 +465,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
break;
emit q->progressValueChanged(event->index1);
- if (event->text != QString()) // ###
+ if (!event->text.isNull()) // ###
q->progressTextChanged(event->text);
break;
case QFutureCallOutEvent::ProgressRange:
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index a23b2dd..f6ce4b3 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1696,7 +1696,7 @@ QString QCoreApplication::applicationDirPath()
}
QCoreApplicationPrivate *d = self->d_func();
- if (d->cachedApplicationDirPath == QString())
+ if (d->cachedApplicationDirPath.isNull())
d->cachedApplicationDirPath = QFileInfo(applicationFilePath()).path();
return d->cachedApplicationDirPath;
}
@@ -1724,7 +1724,7 @@ QString QCoreApplication::applicationFilePath()
}
QCoreApplicationPrivate *d = self->d_func();
- if (d->cachedApplicationFilePath != QString())
+ if (!d->cachedApplicationFilePath.isNull())
return d->cachedApplicationFilePath;
#if defined( Q_WS_WIN )
diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp
index db76ef2..1faa63a 100644
--- a/tools/macdeployqt/shared/shared.cpp
+++ b/tools/macdeployqt/shared/shared.cpp
@@ -343,7 +343,7 @@ DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks, const QString
copiedFrameworks.append(framework.frameworkName);
// Get the qt path from one of the Qt frameworks;
- if (deploymenInfo.qtPath == QString() && framework.frameworkName.contains("Qt")
+ if (deploymenInfo.qtPath.isNull() && framework.frameworkName.contains("Qt")
&& framework.frameworkDirectory.contains("/lib"))
{
deploymenInfo.qtPath = framework.frameworkDirectory;
@@ -364,7 +364,7 @@ DeploymentInfo deployQtFrameworks(QList<FrameworkInfo> frameworks, const QString
// Copy farmework to app bundle.
const QString deployedBinaryPath = copyFramework(framework, bundlePath);
// Skip the rest if already was deployed.
- if (deployedBinaryPath == QString())
+ if (deployedBinaryPath.isNull())
continue;
runStrip(deployedBinaryPath);
diff --git a/tools/porting/src/portingrules.cpp b/tools/porting/src/portingrules.cpp
index 4931064..cd29403 100644
--- a/tools/porting/src/portingrules.cpp
+++ b/tools/porting/src/portingrules.cpp
@@ -189,7 +189,7 @@ void PortingRules::parseXml(QString fileName)
QString includeFile = xml[QLatin1String("Rules")][QLatin1String("Include")].text();
- if(includeFile != QString()) {
+ if(!includeFile.isNull()) {
QString resolvedIncludeFile = resolveFileName(fileName, includeFile);
if (!resolvedIncludeFile.isEmpty())
parseXml(resolvedIncludeFile);