Skip to content

Commit

Permalink
don't clear the rest of the command line when -redo is used
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ossilator committed Jul 22, 2016
1 parent 6b4496c commit 2152049
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions tools/configure/configureapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/configure/configureapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class Configure
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);
Expand Down

0 comments on commit 2152049

Please sign in to comment.