[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Jun 24 21:18:08 CEST 2003


CVS commit by staikos: 

session management works now


  M +6 -4      kst.cpp   1.28


--- kdeextragear-2/kst/kst/kst.cpp  #1.27:1.28
@@ -500,12 +500,14 @@ void KstApp::readOptions() {
 
 void KstApp::saveProperties(KConfig *config) {
-  //doc->saveDocument("/tmp/testfile");
-  QString name = doc->getAbsFilePath();
-  if (!name.isEmpty() || doc->getTitle() == i18n("Untitled")) {
+  QString name = doc->getAbsFilePath() + doc->getTitle();
+  if (!name.isEmpty() && doc->getTitle() != i18n("Untitled")) {
     config->writePathEntry("Document", name);
     config->writeEntry("NamedDocument", true);
   } else {
     QString sl = KGlobal::dirs()->saveLocation("kst", "kst/");
-    name = sl + "unsaved.kst";
+    int i = 0;
+    do {
+      name = sl + QString("unsaved%1.kst").arg(i);
+    } while(QFile::exists(name));
     doc->saveDocument(name);
     config->writePathEntry("Document", name);




More information about the Kst mailing list