[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Mar 18 03:40:08 CET 2005


CVS commit by staikos: 

make it Qt 3.1 compatible


  M +14 -0     kstplotimagedrag.cpp   1.3


--- kdeextragear-2/kst/kst/kstplotimagedrag.cpp  #1.2:1.3
@@ -23,6 +23,8 @@
 #include <kimageio.h>
 #include <kprogress.h>
+#include <ktempfile.h>
 
 #include <qeventloop.h>
+#include <qfile.h>
 #include <qpainter.h>
 #include <qpixmap.h>
@@ -114,5 +116,17 @@ QByteArray KstPlotImageDrag::encodedData
   QByteArray rc;
   QDataStream ds(rc, IO_WriteOnly);
+#if QT_VERSION < 0x030200
+  KTempFile tf;
+  pm.save(tf.name(), KImageIO::typeForMime(mimeType).latin1());
+  tf.close();
+  QFile f(tf.name());
+  if (f.open(IO_ReadOnly)) {
+    rc = f.readAll();
+    f.close();
+  }
+  QFile::remove(tf.name());
+#else
   pm.save(ds.device(), KImageIO::typeForMime(mimeType).latin1());
+#endif
 
   return rc;




More information about the Kst mailing list