[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Jun 27 08:24:30 CEST 2003


CVS commit by staikos: 

KIO enable image saving


  M +4 -3      kstgraphfiledialog_i.cpp   1.5
  M +3 -3      kstgraphfiledialog_i.h   1.5
  M +14 -1     kstview.cpp   1.15


--- kdeextragear-2/kst/kst/kstgraphfiledialog_i.cpp  #1.4:1.5
@@ -17,11 +17,12 @@ KstGraphFileDialogI::KstGraphFileDialogI
 
   connect(_square,       SIGNAL(clicked()),         this, SLOT(xsizeChanged()));
-  connect(_xSize,        SIGNAL(valueChanged(int)), this, SLOT(xsizeChanged()));
   connect(_save,         SIGNAL(clicked()),         this, SLOT(reqGraphFile()));
   connect(_autosave,     SIGNAL(toggled(bool)),     this, SLOT(setAutoSave()));
   connect(_period,       SIGNAL(valueChanged(int)), this, SLOT(setAutoSave()));
   connect(autoSaveTimer, SIGNAL(timeout()),         this, SLOT(reqGraphFile()));
+  connect(_xSize,     SIGNAL(valueChanged(int)), this, SLOT(xsizeChanged(int)));
 
   _url->fileDialog()->setFilter(KImageIO::mimeTypes().join(" "));
+  _url->fileDialog()->setMode(KFile::File);
 }
 
@@ -34,7 +35,7 @@ void  KstGraphFileDialogI::showGraphFile
 }
 
-void KstGraphFileDialogI::xsizeChanged() {
+void KstGraphFileDialogI::xsizeChanged(int x) {
   if (_square->isChecked()) {
-    _ySize->setValue(_xSize->value());
+    _ySize->setValue(x);
   }
 }

--- kdeextragear-2/kst/kst/kstgraphfiledialog_i.h  #1.4:1.5
@@ -14,10 +14,10 @@ public slots:
   /** shows/raises the dialog */
   void showGraphFileDialog();
-
-  void xsizeChanged();
-
   void reqGraphFile();
 
+private slots:
+  void xsizeChanged(int x);
   void setAutoSave();
+
 private:
   QTimer *autoSaveTimer;

--- kdeextragear-2/kst/kst/kstview.cpp  #1.14:1.15
@@ -28,4 +28,7 @@
 #include <qtabwidget.h>
 
+#include <kurl.h>
+#include <ktempfile.h>
+#include <kio/netaccess.h>
 #include <klocale.h>
 
@@ -150,5 +153,15 @@ void KstView::printToGraphicsFile(const 
     type = "PNG";
   }
-  tmpPixmap.save(filename, type.latin1());
+  
+  KURL url = KURL::fromPathOrURL(filename);
+  if (url.isLocalFile()) {
+    tmpPixmap.save(url.path(), type.latin1());
+  } else {
+    KTempFile tf;
+    tf.close();
+    tf.setAutoDelete(true);
+    tmpPixmap.save(tf.name(), type.latin1());
+    KIO::NetAccess::upload(tf.name(), url, this);
+  }
 }
 




More information about the Kst mailing list