comparison main/main.cpp @ 2126:0b15f3b16776 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:35:05 +0000
parents 0f5ff52655ec
children 76b1c50f1f6d
comparison
equal deleted inserted replaced
2125:124de219669f 2126:0b15f3b16776
199 public: 199 public:
200 SVApplication(int &argc, char **argv) : 200 SVApplication(int &argc, char **argv) :
201 QApplication(argc, argv), 201 QApplication(argc, argv),
202 m_readyForFiles(false), 202 m_readyForFiles(false),
203 m_filepathQueue(QStringList()), 203 m_filepathQueue(QStringList()),
204 m_mainWindow(0) 204 m_mainWindow(nullptr)
205 { 205 {
206 } 206 }
207 ~SVApplication() override { } 207 ~SVApplication() override { }
208 208
209 void setMainWindow(MainWindow *mw) { m_mainWindow = mw; } 209 void setMainWindow(MainWindow *mw) { m_mainWindow = mw; }
210 void releaseMainWindow() { m_mainWindow = 0; } 210 void releaseMainWindow() { m_mainWindow = nullptr; }
211 211
212 virtual void commitData(QSessionManager &manager) { 212 virtual void commitData(QSessionManager &manager) {
213 if (!m_mainWindow) return; 213 if (!m_mainWindow) return;
214 bool mayAskUser = manager.allowsInteraction(); 214 bool mayAskUser = manager.allowsInteraction();
215 bool success = m_mainWindow->commitData(mayAskUser); 215 bool success = m_mainWindow->commitData(mayAskUser);
279 QApplication::setOrganizationDomain("sonicvisualiser.org"); 279 QApplication::setOrganizationDomain("sonicvisualiser.org");
280 QApplication::setApplicationName(QApplication::tr("Sonic Visualiser")); 280 QApplication::setApplicationName(QApplication::tr("Sonic Visualiser"));
281 281
282 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); 282 QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
283 283
284 SVSplash *splash = 0; 284 SVSplash *splash = nullptr;
285 285
286 QSettings settings; 286 QSettings settings;
287 287
288 settings.beginGroup("Preferences"); 288 settings.beginGroup("Preferences");
289 // Default to using Piper server; can change in preferences 289 // Default to using Piper server; can change in preferences
490 490
491 switch (event->type()) { 491 switch (event->type()) {
492 case QEvent::FileOpen: 492 case QEvent::FileOpen:
493 thePath = static_cast<QFileOpenEvent *>(event)->file(); 493 thePath = static_cast<QFileOpenEvent *>(event)->file();
494 if(m_readyForFiles) 494 if(m_readyForFiles)
495 handleFilepathArgument(thePath, NULL); 495 handleFilepathArgument(thePath, nullptr);
496 else 496 else
497 m_filepathQueue.append(thePath); 497 m_filepathQueue.append(thePath);
498 return true; 498 return true;
499 default: 499 default:
500 return QApplication::event(event); 500 return QApplication::event(event);