diff data/fileio/FileSource.cpp @ 1582:70e172e6cc59 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:33:41 +0000
parents cee1be4fb8c1
children 7001b9570e37
line wrap: on
line diff
--- a/data/fileio/FileSource.cpp	Mon Nov 26 13:51:36 2018 +0000
+++ b/data/fileio/FileSource.cpp	Mon Nov 26 14:33:41 2018 +0000
@@ -91,8 +91,8 @@
                        QString preferredContentType) :
     m_rawFileOrUrl(fileOrUrl),
     m_url(fileOrUrl, QUrl::StrictMode),
-    m_localFile(0),
-    m_reply(0),
+    m_localFile(nullptr),
+    m_reply(nullptr),
     m_preferredContentType(preferredContentType),
     m_ok(false),
     m_cancelled(false),
@@ -182,8 +182,8 @@
 
 FileSource::FileSource(QUrl url, ProgressReporter *reporter) :
     m_url(url),
-    m_localFile(0),
-    m_reply(0),
+    m_localFile(nullptr),
+    m_reply(nullptr),
     m_ok(false),
     m_cancelled(false),
     m_lastStatus(0),
@@ -215,8 +215,8 @@
 FileSource::FileSource(const FileSource &rf) :
     QObject(),
     m_url(rf.m_url),
-    m_localFile(0),
-    m_reply(0),
+    m_localFile(nullptr),
+    m_reply(nullptr),
     m_ok(rf.m_ok),
     m_cancelled(rf.m_cancelled),
     m_lastStatus(rf.m_lastStatus),
@@ -385,7 +385,7 @@
         qint64 written = m_localFile->write(ba);
         m_localFile->close();
         delete m_localFile;
-        m_localFile = 0;
+        m_localFile = nullptr;
 
         if (written != ba.size()) {
 #ifdef DEBUG_FILE_SOURCE
@@ -502,13 +502,13 @@
 {
     if (m_done) {
         delete m_localFile; // does not actually delete the file
-        m_localFile = 0;
+        m_localFile = nullptr;
     }
     m_done = true;
     if (m_reply) {
         QNetworkReply *r = m_reply;
-        disconnect(r, 0, this, 0);
-        m_reply = 0;
+        disconnect(r, nullptr, this, nullptr);
+        m_reply = nullptr;
         // Can only call abort() when there are no errors.
         if (r->error() == QNetworkReply::NoError) {
             r->abort();
@@ -517,7 +517,7 @@
     }
     if (m_localFile) {
         delete m_localFile; // does not actually delete the file
-        m_localFile = 0;
+        m_localFile = nullptr;
     }
 }
 
@@ -693,7 +693,7 @@
                 incCount(newUrl.toString());
 #endif
                 m_url = newUrl;
-                m_localFile = 0;
+                m_localFile = nullptr;
                 m_lastStatus = 0;
                 m_done = false;
                 m_refCounted = false;