# HG changeset patch # User Chris Cannam # Date 1226600253 0 # Node ID d27c322b5d6e4af96ec70760d983dbb91a532815 # Parent 64a8ee01100464bea3442d4a4b825173e8f46388 * Avoid crash when "hiding" non-visible splash (I don't quite understand this one, but hey) diff -r 64a8ee011004 -r d27c322b5d6e main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Nov 13 14:23:23 2008 +0000 +++ b/main/MainWindow.cpp Thu Nov 13 18:17:33 2008 +0000 @@ -271,7 +271,7 @@ newSession(); -//!!! TransformFactory::getInstance()->startPopulationThread(); + TransformFactory::getInstance()->startPopulationThread(); } MainWindow::~MainWindow() diff -r 64a8ee011004 -r d27c322b5d6e main/main.cpp --- a/main/main.cpp Thu Nov 13 14:23:23 2008 +0000 +++ b/main/main.cpp Thu Nov 13 18:17:33 2008 +0000 @@ -21,7 +21,6 @@ #include "base/PropertyContainer.h" #include "base/Preferences.h" #include "widgets/TipDialog.h" -#include "rdf/SimpleSPARQLQuery.h" #include #include @@ -237,14 +236,15 @@ QApplication::setApplicationName(QApplication::tr("Sonic Visualiser")); QPixmap pixmap(":/icons/sv-splash.png"); - QSplashScreen splash(pixmap); + QSplashScreen *splash = 0; QSettings settings; settings.beginGroup("Preferences"); if (settings.value("show-splash", true).toBool()) { - splash.show(); - QTimer::singleShot(5000, &splash, SLOT(hide())); + splash = new QSplashScreen(pixmap); + splash->show(); + QTimer::singleShot(5000, splash, SLOT(hide())); application.processEvents(); } settings.endGroup(); @@ -257,10 +257,6 @@ } settings.endGroup(); - SimpleSPARQLQuery::setImplementationPreference - (SimpleSPARQLQuery::UseDatastore); -// (SimpleSPARQLQuery::UseDirectParser); - QIcon icon; int sizes[] = { 16, 22, 24, 32, 48, 64, 128 }; for (int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) { @@ -303,7 +299,9 @@ MainWindow *gui = new MainWindow(audioOutput, oscSupport); application.setMainWindow(gui); - QObject::connect(gui, SIGNAL(hideSplash()), &splash, SLOT(hide())); + if (splash) { + QObject::connect(gui, SIGNAL(hideSplash()), splash, SLOT(hide())); + } QDesktopWidget *desktop = QApplication::desktop(); QRect available = desktop->availableGeometry(); @@ -371,12 +369,12 @@ } } if (status == MainWindow::FileOpenFailed) { - splash.hide(); + if (splash) splash->hide(); QMessageBox::critical (gui, QMessageBox::tr("Failed to open file"), QMessageBox::tr("File or URL \"%1\" could not be opened").arg(path)); } else if (status == MainWindow::FileOpenWrongMode) { - splash.hide(); + if (splash) splash->hide(); QMessageBox::critical (gui, QMessageBox::tr("Failed to open file"), QMessageBox::tr("Audio required

Please load at least one audio file before importing annotation data")); @@ -398,7 +396,8 @@ settings.endGroup(); #endif - splash.finish(gui); + if (splash) splash->finish(gui); + delete splash; /* TipDialog tipDialog;