Extract to cfgdir
authorunc0rr
Sun, 04 Sep 2011 19:04:36 +0400
changeset 5762 0d6a338bf377
parent 5761 e991f19132af
child 5763 d7a887c7e2d0
Extract to cfgdir
QTfrontend/pagedata.cpp
--- a/QTfrontend/pagedata.cpp	Sun Sep 04 10:54:00 2011 -0400
+++ b/QTfrontend/pagedata.cpp	Sun Sep 04 19:04:36 2011 +0400
@@ -29,6 +29,7 @@
 
 #include "pagedata.h"
 #include "databrowser.h"
+#include "hwconsts.h"
 
 #include "quazip.h"
 #include "quazipfile.h"
@@ -141,6 +142,9 @@
 
     QuaZipFile file(&zip);
 
+    QDir extractDir(*cfgdir);
+    extractDir.cd("Data");
+
     for(bool more = zip.goToFirstFile(); more; more = zip.goToNextFile())
     {
         if(!file.open(QIODevice::ReadOnly))
@@ -151,14 +155,14 @@
 
 
         QString fileName = file.getActualFileName();
-        QString filePath = QDir::tempPath() + "/" + fileName;
+        QString filePath = extractDir.filePath(fileName);
         if (fileName.endsWith("/"))
         {
             QFileInfo fi(filePath);
             QDir().mkpath(fi.filePath());
         } else
         {
-            qDebug() << filePath;
+            qDebug() << "Extracting" << filePath;
             QFile out(filePath);
             if(!out.open(QFile::WriteOnly))
             {