From 2e1248537e73e28e5ee8c345507cf8c59cca893b Mon Sep 17 00:00:00 2001 From: pvdk Date: Mon, 17 Mar 2014 21:33:44 +0100 Subject: [PATCH] Minor fixes, installation should stop after one error message now --- apps/wizard/conclusionpage.cpp | 10 +++++----- apps/wizard/unshield/unshieldworker.cpp | 17 +++++++++-------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/apps/wizard/conclusionpage.cpp b/apps/wizard/conclusionpage.cpp index 7b638813b..932a9715c 100644 --- a/apps/wizard/conclusionpage.cpp +++ b/apps/wizard/conclusionpage.cpp @@ -13,11 +13,11 @@ Wizard::ConclusionPage::ConclusionPage(MainWizard *wizard) : void Wizard::ConclusionPage::initializePage() { -// // Write the path to openmw.cfg -// if (field(QLatin1String("installation.new")).toBool() == true) { -// QString path(field(QLatin1String("installation.path")).toString()); -// mWizard->addInstallation(path); -// } + // Write the path to openmw.cfg + if (field(QLatin1String("installation.new")).toBool() == true) { + QString path(field(QLatin1String("installation.path")).toString()); + mWizard->addInstallation(path); + } if (!mWizard->mError) { diff --git a/apps/wizard/unshield/unshieldworker.cpp b/apps/wizard/unshield/unshieldworker.cpp index 2319ca0df..aceac69b8 100644 --- a/apps/wizard/unshield/unshieldworker.cpp +++ b/apps/wizard/unshield/unshieldworker.cpp @@ -251,16 +251,15 @@ bool Wizard::UnshieldWorker::copyDirectory(const QString &source, const QString { QDir sourceDir(source); QDir destDir(destination); - bool result = false; + bool result = true; if (!destDir.exists()) { - if (!sourceDir.mkpath(destination)) { + if (!sourceDir.mkpath(destination)) return false; - } - - destDir.refresh(); } + destDir.refresh(); + if (!destDir.exists()) return false; @@ -387,7 +386,7 @@ void Wizard::UnshieldWorker::extract() writeSettings(); // Remove the temporary directory - removeDirectory(getPath() + QDir::separator() + QLatin1String("extract-temp")); + //removeDirectory(getPath() + QDir::separator() + QLatin1String("extract-temp")); // Fill the progress bar int total = 0; @@ -572,6 +571,7 @@ bool Wizard::UnshieldWorker::installComponent(Component component, const QString if (!installDirectories(dir, info.absolutePath(), false, true)) { emit error(tr("Could not install directory!"), tr("Installing %1 to %2 failed.").arg(dir, info.absolutePath())); + return false; } } @@ -626,6 +626,7 @@ bool Wizard::UnshieldWorker::installComponent(Component component, const QString if (!copyDirectory(sounds.absoluteFilePath(), dest)) { emit error(tr("Could not install directory!"), tr("Installing %1 to %2 failed.").arg(sounds.absoluteFilePath(), dest)); + return false; } } @@ -699,7 +700,7 @@ bool Wizard::UnshieldWorker::installComponent(Component component, const QString bool Wizard::UnshieldWorker::extractFile(Unshield *unshield, const QString &destination, const QString &prefix, int index, int counter) { - bool success; + bool success = false; QString path(destination); path.append(QDir::separator()); @@ -845,7 +846,7 @@ bool Wizard::UnshieldWorker::findInCab(const QString &cabFile, const QString &fi bool Wizard::UnshieldWorker::extractCab(const QString &cabFile, const QString &destination) { - bool success; + bool success = false; QByteArray array(cabFile.toUtf8());