From c92f0d204926862a00101d2b124abacc9bf6977f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 24 Aug 2016 14:24:15 +0200 Subject: [PATCH] make failure to apply -redo fatal like it already is on unix. Change-Id: Id55f8743ae0879fabe13c19ea214da74a35e43a6 Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 14 ++++++++++---- tools/configure/configureapp.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 890f06a9a7..24f89318fa 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -201,7 +201,10 @@ void Configure::parseCmdLine() if (configCmdLine.at(k) == "-redo") { dictionary["REDO"] = "yes"; configCmdLine.removeAt(k); - reloadCmdLine(k); + if (!reloadCmdLine(k)) { + dictionary["DONE"] = "error"; + return; + } argCount = configCmdLine.size(); break; } @@ -1175,20 +1178,23 @@ void Configure::readLicense() } } -void Configure::reloadCmdLine(int idx) +bool Configure::reloadCmdLine(int idx) { QFile inFile(buildPathMangled + "/config.opt"); if (!inFile.open(QFile::ReadOnly)) { inFile.setFileName(buildPath + "/config.opt"); if (!inFile.open(QFile::ReadOnly)) { inFile.setFileName(buildPath + "/configure.cache"); - if (!inFile.open(QFile::ReadOnly)) - return; + if (!inFile.open(QFile::ReadOnly)) { + cout << "No config.opt present - cannot redo configuration." << endl; + return false; + } } } QTextStream inStream(&inFile); while (!inStream.atEnd()) configCmdLine.insert(idx++, inStream.readLine().trimmed()); + return true; } void Configure::saveCmdLine() diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index da7d8885ce..436c9307b1 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -85,7 +85,7 @@ private: void addConfStr(int group, const QString &val); QString formatPath(const QString &path); - void reloadCmdLine(int idx); + bool reloadCmdLine(int idx); void saveCmdLine(); void applySpecSpecifics();