MCPcopy Create free account
hub / github.com/KDE/kdevelop / queryQMake

Method queryQMake

plugins/qmakemanager/qmakeconfig.cpp:95–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95QHash<QString, QString> QMakeConfig::queryQMake(const QString& qmakeExecutable, const QStringList& args)
96{
97 QHash<QString, QString> hash;
98 KProcess p;
99 p.setOutputChannelMode(KProcess::OnlyStdoutChannel);
100 p << qmakeExecutable << QStringLiteral("-query") << args;
101
102 const int rc = p.execute();
103 if (rc != 0) {
104 qCWarning(KDEV_QMAKE) << "failed to execute qmake query " << p.program().join(QLatin1Char(' ')) << "return code was:" << rc;
105 return QHash<QString, QString>();
106 }
107
108 // TODO: Qt 5.5: Use QTextStream::readLineInto
109 QTextStream stream(&p);
110 while (!stream.atEnd()) {
111 const QString line = stream.readLine();
112 const int colon = line.indexOf(QLatin1Char(':'));
113 if (colon == -1) {
114 continue;
115 }
116
117 const auto key = line.left(colon);
118 const auto value = line.mid(colon + 1);
119 hash.insert(key, value);
120 }
121 qCDebug(KDEV_QMAKE) << "Ran qmake (" << p.program().join(QLatin1Char(' ')) << "), found:" << hash;
122 return hash;
123}
124
125QString QMakeConfig::findBasicMkSpec(const QHash<QString, QString>& qmakeVars)
126{

Callers

nothing calls this directly

Calls 7

joinMethod · 0.80
atEndMethod · 0.80
readLineMethod · 0.80
midMethod · 0.80
executeMethod · 0.45
indexOfMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected