Maemo: Move MADDE environment information out of MaemoToolChain class.

The toolchain is not available in all places where we need the
respective information, which resulted in duplicated code.
This commit is contained in:
Christian Kandeler
2011-01-04 14:14:12 +01:00
parent d909d8ba64
commit 3cb34cf8ec
24 changed files with 199 additions and 243 deletions

View File

@@ -92,19 +92,14 @@ MaemoQemuRuntimeParser::MaemoQemuRuntimeParser(const QString &madInfoOutput,
MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtVersion *qtVersion)
{
MaemoQemuRuntime runtime;
const QString maddeRootPath
= MaemoGlobal::maddeRoot(qtVersion->qmakeCommand());
const QString madCommand = maddeRootPath + QLatin1String("/bin/mad");
if (!QFileInfo(madCommand).exists())
return runtime;
const QString maddeRootPath = MaemoGlobal::maddeRoot(qtVersion);
QProcess madProc;
MaemoGlobal::callMaddeShellScript(madProc, maddeRootPath, madCommand,
QStringList() << QLatin1String("info"));
if (!MaemoGlobal::callMad(madProc, QStringList() << QLatin1String("info"), qtVersion))
return runtime;
if (!madProc.waitForStarted() || !madProc.waitForFinished())
return runtime;
const QByteArray &madInfoOutput = madProc.readAllStandardOutput();
const QString &targetName
= MaemoGlobal::targetName(qtVersion->qmakeCommand());
const QString &targetName = MaemoGlobal::targetName(qtVersion);
runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
.parseRuntime();
if (!runtime.m_name.isEmpty()) {