[Kst] branches/work/kst/portto4/kst/src/libkst

Adam Treat treat at kde.org
Wed Jul 4 18:25:07 CEST 2007


SVN commit 683352 by treat:

* No more kcodecs


 M  +2 -4      kstamatrix.cpp  
 M  +2 -4      kstvector.cpp  


--- branches/work/kst/portto4/kst/src/libkst/kstamatrix.cpp #683351:683352
@@ -23,7 +23,6 @@
 #include <qbytearray.h>
 #include <qtextdocument.h>
 #include "kst_i18n.h"
-#include <kcodecs.h>
 
 KstAMatrix::KstAMatrix(const QDomElement &e) : KstMatrix() {
   _editable = true;
@@ -66,8 +65,7 @@
       if (!e.isNull()) {
         if (e.tagName() == "data") {
           QString qcs(e.text().toLatin1());
-          QByteArray qbca;
-          KCodecs::base64Decode(qcs.toLatin1(), qbca);
+          QByteArray qbca = QByteArray::fromBase64(qcs.toLatin1());
           QByteArray qba = qUncompress(qbca);
           QDataStream qds(&qba, QIODevice::ReadOnly);
           int i;
@@ -114,7 +112,7 @@
   ts << indent << indent2 << "<ny>" << yNumSteps() << "</ny>" << endl;
   ts << indent << indent2 << "<xstep>" << xStepSize() << "</xstep>" << endl;
   ts << indent << indent2 << "<ystep>" << xStepSize() << "</ystep>" << endl;
-  ts << indent << indent2 << "<data>" << KCodecs::base64Encode(qCompress(qba)) << "</data>" << endl;
+  ts << indent << indent2 << "<data>" << qCompress(qba).toBase64() << "</data>" << endl;
   ts << indent << "</amatrix>" << endl;
 }
 
--- branches/work/kst/portto4/kst/src/libkst/kstvector.cpp #683351:683352
@@ -23,7 +23,6 @@
 #include <qtextdocument.h>
 
 #include "kst_i18n.h"
-#include <kcodecs.h>
 
 #include <qdebug.h>
 #include "kstdatacollection.h"
@@ -105,8 +104,7 @@
         in_tag = KstObjectTag::fromString(e.text());
       } else if (e.tagName() == "data") {
         QString qcs(e.text().toLatin1());
-        QByteArray qbca;
-        KCodecs::base64Decode(qcs.toLatin1(), qbca);
+        QByteArray qbca = QByteArray::fromBase64(qcs.toLatin1());
         qba = qUncompress(qbca);
         sz = qMax((size_t)(INITSIZE), qba.size()/sizeof(double));
       }
@@ -592,7 +590,7 @@
       qds << _v[i];
     }
 
-    ts << indent << "<data>" << KCodecs::base64Encode(qCompress(qba)) << "</data>" << endl;
+    ts << indent << "<data>" << qCompress(qba).toBase64() << "</data>" << endl;
   }
 }
 


More information about the Kst mailing list