diff --git a/src/TomahawkApp.cpp b/src/TomahawkApp.cpp index f3ac2a95c..ec7dc8ea3 100644 --- a/src/TomahawkApp.cpp +++ b/src/TomahawkApp.cpp @@ -707,6 +707,27 @@ TomahawkApp::loadUrl( const QString& url ) } +bool +TomahawkApp::notify( QObject *receiver, QEvent *e ) +{ + try + { + return TOMAHAWK_APPLICATION::notify( receiver, e ); + } + catch ( const std::exception& e ) + { + qWarning( "TomahawkApp::notify caught a std exception in a Qt event handler: " ); + qFatal( e.what() ); + } + catch ( ... ) + { + qFatal( "TomahawkApp::notify caught a non-std-exception from a Qt event handler. Aborting." ); + } + + return false; +} + + void TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance ) { diff --git a/src/TomahawkApp.h b/src/TomahawkApp.h index 417bc3094..74cfffc11 100644 --- a/src/TomahawkApp.h +++ b/src/TomahawkApp.h @@ -99,6 +99,9 @@ public: bool isTomahawkLoaded() const { return m_loaded; } + // reimplemented from QApplication/QCoreApplication + virtual bool notify( QObject* receiver, QEvent* e ); + signals: void tomahawkLoaded();