forked from qt-creator/qt-creator
		
	Maemo: Move .pro file scope generation to a dedicated function.
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user