comparison data/fileio/PlaylistFileReader.cpp @ 1582:70e172e6cc59 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:33:41 +0000
parents 48e9f538e6e9
children f36fef97ac81
comparison
equal deleted inserted replaced
1581:ad5f892c0c4d 1582:70e172e6cc59
23 23
24 #include <iostream> 24 #include <iostream>
25 25
26 PlaylistFileReader::PlaylistFileReader(QString path) : 26 PlaylistFileReader::PlaylistFileReader(QString path) :
27 m_source(path), 27 m_source(path),
28 m_file(0) 28 m_file(nullptr)
29 { 29 {
30 if (!m_source.isAvailable()) { 30 if (!m_source.isAvailable()) {
31 m_error = QFile::tr("File or URL \"%1\" could not be retrieved") 31 m_error = QFile::tr("File or URL \"%1\" could not be retrieved")
32 .arg(path); 32 .arg(path);
33 return; 33 return;
35 init(); 35 init();
36 } 36 }
37 37
38 PlaylistFileReader::PlaylistFileReader(FileSource source) : 38 PlaylistFileReader::PlaylistFileReader(FileSource source) :
39 m_source(source), 39 m_source(source),
40 m_file(0) 40 m_file(nullptr)
41 { 41 {
42 if (!m_source.isAvailable()) { 42 if (!m_source.isAvailable()) {
43 m_error = QFile::tr("File or URL \"%1\" could not be retrieved") 43 m_error = QFile::tr("File or URL \"%1\" could not be retrieved")
44 .arg(source.getLocation()); 44 .arg(source.getLocation());
45 return; 45 return;
81 } 81 }
82 } 82 }
83 83
84 if (!good) { 84 if (!good) {
85 delete m_file; 85 delete m_file;
86 m_file = 0; 86 m_file = nullptr;
87 } 87 }
88 } 88 }
89 89
90 bool 90 bool
91 PlaylistFileReader::isOK() const 91 PlaylistFileReader::isOK() const
92 { 92 {
93 return (m_file != 0); 93 return (m_file != nullptr);
94 } 94 }
95 95
96 QString 96 QString
97 PlaylistFileReader::getError() const 97 PlaylistFileReader::getError() const
98 { 98 {