1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Reimplement QApplication::notify() to print out something about the exception if we can

This commit is contained in:
Leo Franchi 2012-06-17 15:29:47 +02:00
parent c1d678e2b1
commit 7b8136a36e
2 changed files with 24 additions and 0 deletions

View File

@ -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 )
{

View File

@ -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();