[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Sun Dec 4 00:27:24 CET 2005


SVN commit 485358 by staikos:

Use more of a hack for the startup-with-window implementation so that the
command-line still works.  Only creates a window if one doesn't exist.
BUG: 117535


 M  +9 -3      kst.cpp  
 M  +1 -0      kst.h  


--- trunk/extragear/graphics/kst/kst/kst.cpp #485357:485358
@@ -917,10 +917,17 @@
 
 void KstApp::initDocument() {
   doc = new KstDoc(this);
-  QTimer::singleShot(0, this, SLOT(slotFileNew()));
+  QTimer::singleShot(0, this, SLOT(delayedDocInit()));
 }
 
 
+void KstApp::delayedDocInit() {
+  if (!activeWindow()) {
+    doc->newDocument();
+  }
+}
+
+
 void KstApp::forceUpdate() {
   _updateThread->forceUpdate();
 }
@@ -1024,6 +1031,7 @@
   config->sync();
 }
 
+
 void KstApp::readOptions() {
   config->setGroup("General Options");
   _recent->loadEntries(config, "Recent Files");
@@ -1156,9 +1164,7 @@
     slotFileSaveAs();
   } else {
     slotUpdateStatusMsg(i18n("Saving file..."));
-
     doc->saveDocument(doc->absFilePath());
-
     slotUpdateStatusMsg(i18n("Ready"));
   }
 }
--- trunk/extragear/graphics/kst/kst/kst.h #485357:485358
@@ -222,6 +222,7 @@
     void fixKMdi();
     void showContextMenu(QWidget *w, const QPoint& pos);
     void showContextMenu(const QPoint& pos);
+    void delayedDocInit();
 
   public slots:
     void fromEnd();


More information about the Kst mailing list