Mercurial > hg > sonic-visualiser
comparison main/main.cpp @ 2196:813bc4295860 bqaudiostream
Merge from default branch
author | Chris Cannam |
---|---|
date | Wed, 23 Jan 2019 14:45:46 +0000 |
parents | 0b15f3b16776 |
children | 76b1c50f1f6d |
comparison
equal
deleted
inserted
replaced
2195:d97c264355a5 | 2196:813bc4295860 |
---|---|
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 virtual ~SVApplication() { } | 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); |
222 bool m_readyForFiles; | 222 bool m_readyForFiles; |
223 QStringList m_filepathQueue; | 223 QStringList m_filepathQueue; |
224 | 224 |
225 protected: | 225 protected: |
226 MainWindow *m_mainWindow; | 226 MainWindow *m_mainWindow; |
227 bool event(QEvent *); | 227 bool event(QEvent *) override; |
228 }; | 228 }; |
229 | 229 |
230 int | 230 int |
231 main(int argc, char **argv) | 231 main(int argc, char **argv) |
232 { | 232 { |
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); |