diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-24 14:24:15 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-25 11:58:17 +0000 |
commit | c92f0d204926862a00101d2b124abacc9bf6977f (patch) | |
tree | 303d095659e8c2c5f5d84a374a68251bd655fa89 /tools/configure/configureapp.cpp | |
parent | 1183e59dd90c3bbc6f807cf472727ae03a15bc70 (diff) |
make failure to apply -redo fatal
like it already is on unix.
Change-Id: Id55f8743ae0879fabe13c19ea214da74a35e43a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r-- | tools/configure/configureapp.cpp | 14 |
1 files changed, 10 insertions, 4 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() |