1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2011-03-25 22:16:12 +00:00
parent 0258895faa
commit 8c1d114dcf
36 changed files with 5880 additions and 3485 deletions

View file

@ -19,13 +19,13 @@
#include "installwindow.h"
#include "ui_installwindowfrm.h"
#include "rbzip.h"
#include "system.h"
#include "rbsettings.h"
#include "serverinfo.h"
#include "systeminfo.h"
#include "utils.h"
#include "rockboxinfo.h"
#include "ziputil.h"
InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
{
@ -55,8 +55,8 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
ui.Backupgroup->hide();
}
backupCheckboxChanged(Qt::Unchecked);
if(ServerInfo::value(ServerInfo::DailyRevision).toString().isEmpty()) {
ui.radioArchived->setEnabled(false);
qDebug() << "[Install] no information about archived version available!";
@ -89,7 +89,7 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
font.setBold(true);
ui.radioCurrent->setFont(font);
}
}
@ -186,6 +186,7 @@ void InstallWindow::accept()
if(ui.backup->isChecked())
{
logger->addItem(tr("Beginning Backup..."),LOGINFO);
QCoreApplication::processEvents();
//! create dir, if it doesnt exist
QFileInfo backupFile(m_backupName);
@ -196,16 +197,20 @@ void InstallWindow::accept()
}
//! create backup
RbZip backup;
connect(&backup,SIGNAL(zipProgress(int,int)),logger,SLOT(setProgress(int,int)));
if(backup.createZip(m_backupName,
RbSettings::value(RbSettings::Mountpoint).toString() + "/.rockbox") == Zip::Ok)
{
logger->addItem(tr("Backup successful"),LOGOK);
bool result = true;
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(m_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 finished."), LOGINFO);
}
else
{
logger->addItem(tr("Backup failed!"),LOGERROR);
else {
logger->addItem(tr("Backup failed!"), LOGERROR);
logger->setFinished();
return;
}