--- mainwindow.cc~ 2009-05-25 11:16:03 +0000 +++ mainwindow.cc 2009-06-25 17:38:54 +0000 @@ -39,6 +39,7 @@ MainWindow::MainWindow( Config::Class & wordFinder( this ), newReleaseCheckTimer( this ) { + force_close = false; applyQtStyleSheet( cfg.preferences.displayStyle ); ui.setupUi( this ); @@ -270,6 +271,8 @@ MainWindow::MainWindow( Config::Class & prepareNewReleaseChecks(); + connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(forceClose())); + // makeDictionaries() didn't do deferred init - we do it here, at the end. doDeferredInit( dictionaries ); } @@ -356,7 +359,7 @@ void MainWindow::updateTrayIcon() void MainWindow::closeEvent( QCloseEvent * ev ) { - if ( cfg.preferences.enableTrayIcon && cfg.preferences.closeToTray ) + if ( cfg.preferences.enableTrayIcon && cfg.preferences.closeToTray && !force_close ) { ev->ignore(); hide(); @@ -1479,3 +1482,8 @@ void MainWindow::applyZoomFactor() if ( scanPopup.get() ) scanPopup->applyZoomFactor(); } + +void MainWindow::forceClose() +{ + force_close = true; +} --- mainwindow.hh~ 2009-05-25 11:16:03 +0000 +++ mainwindow.hh 2009-06-25 17:27:48 +0000 @@ -34,7 +34,7 @@ public: ~MainWindow(); private: - + bool force_close; QSystemTrayIcon * trayIcon; Ui::MainWindow ui; @@ -111,6 +111,7 @@ private: private slots: void hotKeyActivated( int ); + void forceClose(); /// If new release checks are on, santizies the next check time and starts /// the timer. Does nothing otherwise.