Bug 108422 - should start hidden in system tray
Summary: should start hidden in system tray
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-02 01:44 UTC by Matthew robinson
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 Matthew robinson 2005-07-02 01:44:51 UTC
Version:           unknown (using KDE 3.4.1, Debian Package 4:3.4.1-1 (3.1))
Compiler:          gcc version 3.3.6 (Debian 1:3.3.6-5)
OS:                Linux (i686) release 2.6.8-2-386

if akregator was minimised to the tray, it should stay in the tray between sessions, currently it does not.
Comment 1 Heinrich Wendel 2005-07-04 19:33:14 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();
 }