1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 05:37:29 +02:00

Enable the crash reporter before settings are loaded and (in case) deactivate afterwards to catch crashes in settings loading

This commit is contained in:
Dominik Schmidt
2014-08-28 18:43:51 +02:00
parent c41f634e8e
commit c10741f61b

View File

@@ -154,13 +154,21 @@ main( int argc, char *argv[] )
TomahawkApp a( argc, argv ); TomahawkApp a( argc, argv );
#ifdef WITH_CRASHREPORTER
CrashReporter::Handler* handler = new CrashReporter::Handler( QDir::tempPath(), !TomahawkUtils::headless(), "tomahawk_crash_reporter" );
#endif
// MUST register StateHash ****before*** initing TomahawkSettingsGui as constructor of settings does upgrade before Gui subclass registers type // MUST register StateHash ****before*** initing TomahawkSettingsGui as constructor of settings does upgrade before Gui subclass registers type
TomahawkSettings::registerCustomSettingsHandlers(); TomahawkSettings::registerCustomSettingsHandlers();
new TomahawkSettings( &a ); new TomahawkSettings( &a );
#ifdef WITH_CRASHREPORTER #ifdef WITH_CRASHREPORTER
// new CrashReporter::Handler( QDir::tempPath(), TomahawkSettings::instance()->crashReporterEnabled() && !TomahawkUtils::headless(), "tomahawk_crash_reporter" ); if( !TomahawkUtils::headless() )
#endif {
handler->setActive( TomahawkSettings::instance()->crashReporterEnabled() );
}
#endif
KDSingleApplicationGuard guard( KDSingleApplicationGuard::AutoKillOtherInstances ); KDSingleApplicationGuard guard( KDSingleApplicationGuard::AutoKillOtherInstances );
QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) ); QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) );