Commit 233081aa authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Move .pro file scope generation to a dedicated function.

parent 4041a694
......@@ -332,15 +332,8 @@ bool MaemoDeployableListModel::addLinesToProFile(const QStringList &lines)
qWarning("Error opening .pro file for writing.");
return false;
}
QString proFileScope;
const MaemoToolChain *const tc = maemoToolchain();
QTC_ASSERT(tc, return false);
if (tc->version() == MaemoToolChain::Maemo5)
proFileScope = QLatin1String("maemo5");
else
proFileScope = QLatin1String("unix:!symbian:!maemo5");
const QLatin1String separator("\n ");
const QString proFileString = QString(QLatin1Char('\n') + proFileScope
const QString proFileString = QString(QLatin1Char('\n') + proFileScope()
+ QLatin1String(" {") + separator + lines.join(separator)
+ QLatin1String("\n}\n"));
const QByteArray &proFileByteArray = proFileString.toLocal8Bit();
......@@ -369,5 +362,13 @@ const MaemoToolChain *MaemoDeployableListModel::maemoToolchain() const
return tc;
}
QString MaemoDeployableListModel::proFileScope() const
{
const MaemoToolChain *const tc = maemoToolchain();
QTC_ASSERT(tc, return QString());
return QLatin1String(tc->version() == MaemoToolChain::Maemo5
? "maemo5" : "unix:!symbian:!maemo5");
}
} // namespace Qt4ProjectManager
} // namespace Internal
......@@ -94,6 +94,7 @@ private:
bool buildModel();
bool addLinesToProFile(const QStringList &lines);
const MaemoToolChain *maemoToolchain() const;
QString proFileScope() 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