Summary: | Clicking Amarok URL crashes Amarok - segfault | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Valorie Zimmerman <valorie.zimmerman> |
Component: | Tools/Bookmark Manager | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | nhn |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.3.1 |
Description
Valorie Zimmerman
2010-03-22 09:56:23 UTC
commit 4f3679d43f26c5a798694dbc82da4f14f518a4cb Author: Nikolaj Hald Nielsen <nhn@kde.org> Date: Sun Mar 28 15:21:02 2010 +0200 Delay running amarokurls passed on startup until the entire app has had a chance to initialize itself. This fixes a crash. BUG: 231626 diff --git a/src/App.cpp b/src/App.cpp index df6a77f..7677f9b 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -109,6 +109,8 @@ extern void setupEventHandler_mac(long); #include "TestDirectoryLoader.h" #endif // DEBUG +QStringList App::s_delayedAmarokUrls = QStringList(); + AMAROK_EXPORT KAboutData aboutData( "amarok", 0, ki18n( "Amarok" ), AMAROK_VERSION, ki18n( "The audio player for KDE" ), KAboutData::License_GPL, @@ -307,8 +309,7 @@ App::handleCliArgs() //static } else if( url.protocol() == "amarok" ) { - AmarokUrl aUrl( url.url() ); - aUrl.run(); + s_delayedAmarokUrls.append( url.url() ); } else { @@ -783,6 +784,15 @@ App::continueInit() // Using QTimer, so that we won't block the GUI QTimer::singleShot( 0, this, SLOT( checkCollectionScannerVersion() ) ); + + //and now we can run any amarokurls provided on startup, as all components should be initialized by now! + foreach( QString urlString, s_delayedAmarokUrls ) + { + AmarokUrl aUrl( urlString ); + aUrl.run(); + } + s_delayedAmarokUrls.clear(); + } void App::checkCollectionScannerVersion() // SLOT diff --git a/src/App.h b/src/App.h index 0c1c961..4e6c4b0 100644 --- a/src/App.h +++ b/src/App.h @@ -112,6 +112,8 @@ class AMAROK_EXPORT App : public KUniqueApplication QPointer<MainWindow> m_mainWindow; Amarok::TrayIcon *m_tray; MediaDeviceManager *m_mediaDeviceManager; + + static QStringList s_delayedAmarokUrls; }; #define pApp static_cast<App*>(kapp) diff --git a/src/browsers/BrowserWidget.cpp b/src/browsers/BrowserWidget.cpp index fb2337d..011d0d2 100644 --- a/src/browsers/BrowserWidget.cpp +++ b/src/browsers/BrowserWidget.cpp @@ -26,6 +26,7 @@ BrowserWidget::BrowserWidget( QWidget * parent ) : KVBox( parent ) { + DEBUG_BLOCK m_breadcrumbWidget = new BrowserBreadcrumbWidget( this ); new HorizontalDivider( this ); |