Bug 118150

Summary: save sometimes does not default to save-as.
Product: [Applications] kst Reporter: Netterfield <netterfield>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: HI    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Netterfield 2005-12-12 02:16:58 UTC
Version:           1.2.0_devel (using KDE 3.4.3, Gentoo)
Compiler:          gcc version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
OS:                Linux (x86_64) release 2.6.12-gentoo-r6

Create a kst plot from the command line
(eg, kst -y 1 data.dat)

file->save

A sorry dialog appears which complains
": Could not open file for saving. The plot.... [OK]"

Instead, it should default to saveAs.

The bug is particularly serious if, after modified has been set (eg, by adding a label) the user file->quits before saving.  Kst attempts to file-save, as expected, can't, and presents the above sorry box.  Clicking OK closes kst.

If the plots were created by the data wizard instead, this bug does not occur, and the saveAs dialog appears, as expected.
Comment 1 Andrew Walker 2005-12-12 19:51:26 UTC
SVN commit 487974 by arwalker:

BUG:118150 Set the title and modified flag correctly

 M  +1 -1      kst.cpp  
 M  +1 -0      kstdoc.cpp  
 M  +1 -1      main.cpp  


--- trunk/extragear/graphics/kst/kst/kst.cpp #487973:487974
@@ -1160,7 +1160,7 @@
 
 
 void KstApp::slotFileSave() {
-  if (doc->title() == "Untitled") {
+  if (doc->title() == i18n("Untitled")) {
     slotFileSaveAs();
   } else {
     slotUpdateStatusMsg(i18n("Saving file..."));
--- trunk/extragear/graphics/kst/kst/kstdoc.cpp #487973:487974
@@ -73,6 +73,7 @@
   _updating = false;
   _stopping = false;
   _nextEventPaint = false;
+  _title = i18n("Untitled");
 }
 
 KstDoc::~KstDoc() {
--- trunk/extragear/graphics/kst/kst/main.cpp #487973:487974
@@ -795,7 +795,7 @@
     } else {
       args->clear();
       kst->updateDialogs();
-      kst->document()->setModified(false);
+      
       if (showQuickStart) {
         kst->showQuickStartDialog();
       }