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>
This commit is contained in:
Oswald Buddenhagen 2016-07-06 12:47:12 +02:00
parent 6b4496c5f8
commit 2152049db0
2 changed files with 13 additions and 13 deletions

View File

@ -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();
}
}

View File

@ -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);