[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Nov 5 07:47:59 CET 2003


CVS commit by staikos: 

- fix saving of kstfiles
- allow - for stdin


  M +12 -3     kstdatasource.cpp   1.12


--- kdeextragear-2/kst/kst/kstdatasource.cpp  #1.11:1.12
@@ -26,4 +26,5 @@
 
 #include <qfile.h>
+#include <qstylesheet.h>
 
 #include "stdinsource.h"
@@ -165,8 +166,12 @@ static KstDataSourcePtr findPluginFor(co
 KstDataSourcePtr KstDataSource::loadSource(const QString& filename, const QString& type) {
   kdDebug() << "LOAD SOURCE" << endl;
-  if (filename == "stdin") {
+  if (filename == "stdin" || filename == "-") {
     return new KstStdinSource;
   }
 
+  if (filename.isEmpty()) {
+    return 0L;
+  }
+
   return findPluginFor(filename, type);
 }
@@ -189,5 +194,9 @@ KstDataSourcePtr KstDataSource::loadSour
   }
 
-  if (filename == "stdin") {
+  if (filename.isEmpty()) {
+    return 0L;
+  }
+
+  if (filename == "stdin" || filename == "-") {
     return new KstStdinSource;
   }
@@ -261,5 +270,5 @@ QString KstDataSource::fileType() const 
 
 void KstDataSource::save(QTextStream &ts) {
-  Q_UNUSED(ts)
+  ts << " <filename>" << QStyleSheet::escape(_filename) << "</filename>" << endl;
 }
 





More information about the Kst mailing list