diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-07-06 12:47:12 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-07-22 10:28:29 +0000 |
commit | 2152049db0fb1a615dfe46fe6a355abe55a384f3 (patch) | |
tree | 6f9f497f8f34f5d68f03cbab7e1365db37562ca5 /tools | |
parent | 6b4496c5f8fdfa7d4b26b221040f151613446de6 (diff) |
don't clear the rest of the command line when -redo is used
it's entirely reasonable to extend the saved command line by new
arguments. note that these are not saved in turn.
Change-Id: I02c1a2b33e93c85b3a29c50de00c2e5334f6ef51
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 24 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 18f538608e..312316aba3 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -362,19 +362,19 @@ void Configure::parseCmdLine() int argCount = configCmdLine.size(); int i = 0; - if (argCount < 1) // skip rest if no arguments - ; - else if (configCmdLine.at(i) == "-redo") { - dictionary[ "REDO" ] = "yes"; - configCmdLine.clear(); - reloadCmdLine(); + // Look first for -redo + for (int k = 0 ; k < argCount; ++k) { + if (configCmdLine.at(k) == "-redo") { + dictionary["REDO"] = "yes"; + configCmdLine.removeAt(k); + reloadCmdLine(k); + argCount = configCmdLine.size(); + break; + } } - argCount = configCmdLine.size(); - + // Then look for XQMAKESPEC bool isDeviceMkspec = false; - - // Look first for XQMAKESPEC for (int j = 0 ; j < argCount; ++j) { if ((configCmdLine.at(j) == "-xplatform") || (configCmdLine.at(j) == "-device")) { @@ -4222,14 +4222,14 @@ void Configure::readLicense() } } -void Configure::reloadCmdLine() +void Configure::reloadCmdLine(int idx) { if (dictionary[ "REDO" ] == "yes") { QFile inFile(buildPath + "/configure.cache"); if (inFile.open(QFile::ReadOnly)) { QTextStream inStream(&inFile); while (!inStream.atEnd()) - configCmdLine += inStream.readLine().trimmed(); + configCmdLine.insert(idx++, inStream.readLine().trimmed()); inFile.close(); } } diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index bd90ead703..3469b89fc1 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -152,7 +152,7 @@ private: QString locateFile(const QString &fileName) const; bool findFile(const QString &fileName) const { return !locateFile(fileName).isEmpty(); } static QString findFileInPaths(const QString &fileName, const QStringList &paths); - void reloadCmdLine(); + void reloadCmdLine(int idx); void saveCmdLine(); void addSysroot(QString *command); |