[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Sun Feb 20 17:47:09 CET 2005


CVS commit by harris: 

Fixing startup abort.  Until recently, KStars would crash if the user tried 
to abort the startup by closing the splash window.  I fixed this by making 
KStars::closeWindow() call kapp->quit().  However, this change meant that 
when multiple windows are open, closing any of them exits the program.

This commit reverts KStars::closeWindow() to call close(), and connects the 
KStarsSplash closeWindow() SIGNAL to kapp's quit() SLOT (instead of KStars's 
closeWindow() SLOT).  This makes both the startup abort and closing one of 
several windows work correctly.

CCMAIL: kstars-devel at kde.org


  M +1 -1      kstars.cpp   1.90
  M +3 -1      kstarsactions.cpp   1.125


--- kdeedu/kstars/kstars/kstars.cpp  #1.89:1.90
@@ -62,5 +62,5 @@ KStars::KStars( bool doSplash, bool cloc
 
                 pd->splash = new KStarsSplash(0, "Splash");
-                QObject::connect(pd->splash, SIGNAL( closeWindow() ), this, SLOT( closeWindow() ) );
+                QObject::connect(pd->splash, SIGNAL( closeWindow() ), kapp, SLOT( quit() ) );
                 QObject::connect(pd->kstarsData, SIGNAL( progressText(QString) ),
                                 pd->splash, SLOT( setMessage(QString) ));

--- kdeedu/kstars/kstars/kstarsactions.cpp  #1.124:1.125
@@ -388,5 +388,7 @@ void KStars::newWindow() {
 
 void KStars::closeWindow() {
-        QApplication::exit(1);
+        // since QT 3.1 close() just emits lastWindowClosed if the window is not hidden
+        show();
+        close();
 }
 




More information about the Kstars-devel mailing list