Commit c6419ff0 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

less bizarre (and more efficient) argument list creation

parent a6a7e71b
...@@ -1116,20 +1116,22 @@ void QtVersion::updateVersionInfo() const ...@@ -1116,20 +1116,22 @@ void QtVersion::updateVersionInfo() const
m_notInstalled = false; m_notInstalled = false;
QFileInfo qmake(qmakeCommand()); QFileInfo qmake(qmakeCommand());
if (qmake.exists()) { if (qmake.exists()) {
QStringList variables = QStringList() static const char * const variables[] = {
<< "QT_INSTALL_DATA" "QT_INSTALL_DATA",
<< "QT_INSTALL_LIBS" "QT_INSTALL_LIBS",
<< "QT_INSTALL_HEADERS" "QT_INSTALL_HEADERS",
<< "QT_INSTALL_DEMOS" "QT_INSTALL_DEMOS",
<< "QT_INSTALL_EXAMPLES" "QT_INSTALL_EXAMPLES",
<< "QT_INSTALL_CONFIGURATION" "QT_INSTALL_CONFIGURATION",
<< "QT_INSTALL_TRANSLATIONS" "QT_INSTALL_TRANSLATIONS",
<< "QT_INSTALL_PLUGINS" "QT_INSTALL_PLUGINS",
<< "QT_INSTALL_BINS" "QT_INSTALL_BINS",
<< "QT_INSTALL_DOCS" "QT_INSTALL_DOCS",
<< "QT_INSTALL_PREFIX"; "QT_INSTALL_PREFIX"
QStringList args = QStringList() << QString("-query") };
<< variables.join(" -query ").split(" ", QString::SkipEmptyParts); QStringList args;
for (uint i = 0; i < sizeof variables / sizeof variables[0]; ++i)
args << "-query" << variables[i];
QProcess process; QProcess process;
process.start(qmake.absoluteFilePath(), args, QIODevice::ReadOnly); process.start(qmake.absoluteFilePath(), args, QIODevice::ReadOnly);
if (process.waitForFinished(2000)) { if (process.waitForFinished(2000)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment