forked from qt-creator/qt-creator
Maemo: Only add target deployment for the current toolchain.
Task-number: QTCREATORBUG-3222
This commit is contained in:
@@ -76,27 +76,11 @@ bool MaemoDeployableListModel::buildModel()
|
|||||||
const QString remoteDirSuffix
|
const QString remoteDirSuffix
|
||||||
= QLatin1String(m_projectType == LibraryTemplate
|
= QLatin1String(m_projectType == LibraryTemplate
|
||||||
? "/lib" : "/bin");
|
? "/lib" : "/bin");
|
||||||
const QString remoteDirMaemo5
|
const QString remoteDir = QLatin1String("target.path = ")
|
||||||
= QLatin1String("/opt/usr") + remoteDirSuffix;
|
+ installPrefix() + remoteDirSuffix;
|
||||||
const QString remoteDirMaemo6
|
const QStringList deployInfo = QStringList() << remoteDir
|
||||||
= QLatin1String("/usr/local") + remoteDirSuffix;
|
<< QLatin1String("INSTALLS += target");
|
||||||
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
|
return addLinesToProFile(deployInfo);
|
||||||
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;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
|
m_deployables.prepend(MaemoDeployable(localExecutableFilePath(),
|
||||||
m_installsList.targetPath));
|
m_installsList.targetPath));
|
||||||
@@ -370,5 +354,13 @@ QString MaemoDeployableListModel::proFileScope() const
|
|||||||
? "maemo5" : "unix:!symbian:!maemo5");
|
? "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 Qt4ProjectManager
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ private:
|
|||||||
bool addLinesToProFile(const QStringList &lines);
|
bool addLinesToProFile(const QStringList &lines);
|
||||||
const MaemoToolChain *maemoToolchain() const;
|
const MaemoToolChain *maemoToolchain() const;
|
||||||
QString proFileScope() const;
|
QString proFileScope() const;
|
||||||
|
QString installPrefix() const;
|
||||||
|
|
||||||
const Qt4ProjectType m_projectType;
|
const Qt4ProjectType m_projectType;
|
||||||
const QString m_proFilePath;
|
const QString m_proFilePath;
|
||||||
|
|||||||
Reference in New Issue
Block a user