Commit 54667668 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Only add target deployment for the current toolchain.

Task-number: QTCREATORBUG-3222
parent cead4f39
......@@ -76,27 +76,11 @@ bool MaemoDeployableListModel::buildModel()
const QString remoteDirSuffix
= QLatin1String(m_projectType == LibraryTemplate
? "/lib" : "/bin");
const QString remoteDirMaemo5
= QLatin1String("/opt/usr") + remoteDirSuffix;
const QString remoteDirMaemo6
= QLatin1String("/usr/local") + remoteDirSuffix;
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
remoteDirMaemo5));
QFile projectFile(m_proFilePath);
if (!projectFile.open(QIODevice::WriteOnly | QIODevice::Append)) {
qWarning("Error updating .pro file.");
return false;
}
QString proFileTemplate = QLatin1String("\nunix:!symbian {\n"
" maemo5 {\n target.path = maemo5path\n } else {\n"
" target.path = maemo6path\n }\n"
" INSTALLS += target\n}");
proFileTemplate.replace(QLatin1String("maemo5path"), remoteDirMaemo5);
proFileTemplate.replace(QLatin1String("maemo6path"), remoteDirMaemo6);
if (!projectFile.write(proFileTemplate.toLocal8Bit())) {
qWarning("Error updating .pro file.");
return false;
}
const QString remoteDir = QLatin1String("target.path = ")
+ installPrefix() + remoteDirSuffix;
const QStringList deployInfo = QStringList() << remoteDir
<< QLatin1String("INSTALLS += target");
return addLinesToProFile(deployInfo);
} else {
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
m_installsList.targetPath));
......@@ -370,5 +354,13 @@ QString MaemoDeployableListModel::proFileScope() const
? "maemo5" : "unix:!symbian:!maemo5");
}
QString MaemoDeployableListModel::installPrefix() const
{
const MaemoToolChain *const tc = maemoToolchain();
QTC_ASSERT(tc, return QString());
return QLatin1String(tc->version() == MaemoToolChain::Maemo5
? "/opt/usr" : "/usr/local");
}
} // namespace Qt4ProjectManager
} // namespace Internal
......@@ -95,6 +95,7 @@ private:
bool addLinesToProFile(const QStringList &lines);
const MaemoToolChain *maemoToolchain() const;
QString proFileScope() const;
QString installPrefix() const;
const Qt4ProjectType m_projectType;
const QString m_proFilePath;
......
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