Similar to #82757, restoring an akregator session on KDE startup is broken. Only an empty window with a progress bar at 0% is shown. Exiting in this state results in a crash. I suppose that no kpart is loaded during RESTORE (why?). See also http://bugs.kde.org/show_bug.cgi?id=82757
I also have this bug. On startup, akregator has an empty window. Right-clicking on its' icon in the "tray" and selecting quit crashes. Here is the stack trace, let me know if I need to compile more of the components for debugging to make this useful. (no debugging symbols found)...Using host libthread_db library "/lib/libthread_db.so.1". (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...0x41229008 in waitpid () from /lib/libpthread.so.0 #0 0x41229008 in waitpid () from /lib/libpthread.so.0 #1 0x407f7fac in ?? () from /usr/kde/3.2/lib/libkdecore.so.4 #2 0x4073150f in KCrash::defaultCrashHandler () from /usr/kde/3.2/lib/libkdecore.so.4 #3 0x41227d5d in __pthread_clock_settime () from /lib/libpthread.so.0 #4 <signal handler called> #5 0x40035e2e in KParts::ReadWritePart::queryClose () from /usr/kde/3.2/lib/libkparts.so.2 #6 0x08055100 in QGList::count () #7 0x00000000 in ?? () #8 0xbfffe1c0 in ?? () #9 0xbfffe1e8 in ?? () #10 0x40b0e6cc in QObject::activate_filters () from /usr/qt/3/lib/libqt-mt.so.3
CVS commit by sashmit: implement session management CCMAIL: 82868-done@bugs.kde.org M +10 -9 akregator.cpp 1.46 --- kdenonbeta/akregator/src/akregator.cpp #1.45:1.46 @@ -192,17 +192,18 @@ void aKregator::setupActions() } -void aKregator::saveProperties(KConfig* /*config*/) +void aKregator::saveProperties(KConfig* config) { - // the 'config' object points to the session managed - // config file. anything you write here will be available - // later when this app is restored + if (!m_part) + loadPart(); + config->writeEntry("URL",m_part->url().url()); } -void aKregator::readProperties(KConfig* /*config*/) +void aKregator::readProperties(KConfig* config) { - // the 'config' object points to the session managed - // config file. this function is automatically called whenever - // the app is being restored. read in here whatever you wrote - // in 'saveProperties' + KURL u=config->readEntry("URL"); + if (!m_part) // if blank url, load part anyways + loadPart(); + if (u.isValid()) + load(u); }
Current SVN seems to have this bug again.
The Akregator::View is not restored, so there is only an empty main window. This is due to some recent changes in main.cpp. Heinrich, please check :)
I can confirm that with current trunk (compiled two days ago). I have akregator as session app, and every startup of KDE it opens with an empty window, no views but only menus. The only way I have to to restore the view is to quit akregator (*no* crashes at all), and restart it.
SVN commit 431547 by lanius: fix restoring of akregator BUG: 82868 BUG: 108422 M +17 -19 main.cpp --- trunk/KDE/kdepim/akregator/src/main.cpp #431546:431547 @@ -36,7 +36,7 @@ class AkregatorApp : public KUniqueApplication { public: - AkregatorApp() : mMainWindow( 0 ) {} + AkregatorApp() : mMainWindow( ) {} ~AkregatorApp() {} int newInstance(); @@ -47,16 +47,10 @@ int AkregatorApp::newInstance() { - DCOPRef akr("akregator", "AkregatorIface"); + if (!isRestored()) + { + DCOPRef akr("akregator", "AkregatorIface"); - if ( isRestored() ) { - if ( KMainWindow::canBeRestored( 1 ) ) { - mMainWindow = new Akregator::MainWindow(); - setMainWidget( mMainWindow ); - mMainWindow->show(); - mMainWindow->restore( 1 ); - } - } else { if ( !mMainWindow ) { mMainWindow = new Akregator::MainWindow(); setMainWidget( mMainWindow ); @@ -80,7 +74,6 @@ args->clear(); } - return KUniqueApplication::newInstance(); } @@ -91,17 +84,22 @@ KCmdLineArgs::addCmdLineOptions( Akregator::akregator_options ); KUniqueApplication::addCmdLineOptions(); + AkregatorApp app; + // start knotifyclient if not already started. makes it work for people who doesn't use full kde, according to kmail devels KNotifyClient::startDaemon(); - if(!AkregatorApp::start()) - return 0; + // see if we are starting with session management + if (app.isRestored()) + { +#undef RESTORE +#define RESTORE(type) { int n = 1;\ + while (KMainWindow::canBeRestored(n)){\ + (new type)->restore(n, false);\ + n++;}} - AkregatorApp app; + RESTORE(Akregator::MainWindow); + } - bool ret = app.exec(); - while ( KMainWindow::memberList->first() ) - delete KMainWindow::memberList->first(); - - return ret; + return app.exec(); }