Bug 82868 - Restoring akregator session is broken
Summary: Restoring akregator session is broken
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: cvs
Platform: Unlisted Binaries Linux
: VHI major
Target Milestone: ---
Assignee: Stanislav Karchebny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-05 10:08 UTC by Frank Osterfeld
Modified: 2005-07-04 19:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Osterfeld 2004-06-05 10:08:14 UTC
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
Comment 1 Matt Hargett 2004-07-01 19:59:31 UTC
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
Comment 2 Sashmit Bhaduri 2004-07-04 06:59:11 UTC
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);
 }
 


Comment 3 Michel Hermier 2005-06-30 13:24:21 UTC
Current SVN seems to have this bug again.
Comment 4 Frank Osterfeld 2005-06-30 13:31:35 UTC
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 :)
Comment 5 Pino Toscano 2005-07-04 12:32:25 UTC
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.
Comment 6 Heinrich Wendel 2005-07-04 19:33:15 UTC
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();
 }