summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-03-25 22:16:12 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-03-25 22:16:12 +0000
commit8c1d114dcfcc8b3d47505e3139151eec43ebbdc4 (patch)
tree4925e1900520b0c89001c95c9da83f3533903d1e /rbutil/rbutilqt/rbutilqt.cpp
parent0258895faa9a18c0b620ae0a63ee3768ba62747a (diff)
downloadrockbox-8c1d114dcfcc8b3d47505e3139151eec43ebbdc4.tar.gz
rockbox-8c1d114dcfcc8b3d47505e3139151eec43ebbdc4.tar.bz2
rockbox-8c1d114dcfcc8b3d47505e3139151eec43ebbdc4.zip
Rockbox Utility: Replace OSDaB Zip with QuaZip.
This change fixes problems with zip files created with newer zip utilities (a known issue is the iLike theme). QuaZip also allows better feedback during operations without changing the imported code. Additionally Rockbox Utility and the Theme Editor are now both using QuaZip; currently Rockbox Utility uses a copy of the sources, merging them later is planned. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29645 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 328fb5d8c7..f7ae202ab0 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -32,13 +32,13 @@
#include "uninstallwindow.h"
#include "utils.h"
#include "rockboxinfo.h"
-#include "rbzip.h"
#include "sysinfo.h"
#include "system.h"
#include "systrace.h"
#include "rbsettings.h"
#include "serverinfo.h"
#include "systeminfo.h"
+#include "ziputil.h"
#include "progressloggerinterface.h"
@@ -578,6 +578,7 @@ bool RbUtilQt::installAuto()
tr("Rockbox installation detected. Do you want to backup first?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
{
+ bool result;
logger->addItem(tr("Starting backup..."),LOGINFO);
QString backupName = RbSettings::value(RbSettings::Mountpoint).toString()
+ "/.backup/rockbox-backup-" + rbinfo.version() + ".zip";
@@ -590,11 +591,19 @@ bool RbUtilQt::installAuto()
a.mkpath(backupFile.path());
}
+ logger->addItem(tr("Beginning Backup..."),LOGINFO);
+ QCoreApplication::processEvents();
+
//! create backup
- RbZip backup;
- connect(&backup,SIGNAL(zipProgress(int,int)),logger, SLOT(setProgress(int,int)));
- if(backup.createZip(backupName,
- RbSettings::value(RbSettings::Mountpoint).toString() + "/.rockbox") == Zip::Ok)
+ ZipUtil zip(this);
+ connect(&zip, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
+ connect(&zip, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
+ zip.open(backupName, QuaZip::mdCreate);
+ QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
+ QString folder = mp + "/.rockbox";
+ result = zip.appendDirToArchive(folder, mp);
+ zip.close();
+ if(result)
{
logger->addItem(tr("Backup successful"),LOGOK);
}
@@ -1262,13 +1271,13 @@ void RbUtilQt::checkUpdate(void)
#elif defined(Q_OS_MACX)
url += "macosx/";
#endif
-
+
update = new HttpGet(this);
connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool)));
connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort()));
if(RbSettings::value(RbSettings::CacheOffline).toBool())
update->setCache(true);
-
+
ui.statusbar->showMessage(tr("Checking for update ..."));
update->getFile(QUrl(url));
}
@@ -1289,7 +1298,7 @@ void RbUtilQt::downloadUpdateDone(bool error)
rbutilList << searchString.cap(1);
pos += searchString.matchedLength();
}
- qDebug() << "[Checkupdate] " << rbutilList;
+ qDebug() << "[RbUtilQt] Checking for update";
QString newVersion = "";
QString foundVersion = "";