Refactoring. Unduplicating code.

The loop to generate the "DEPLOYMENTFOLDERS" part in the main
.pro file is now in the base class AbstractMobileApp.
This commit is contained in:
Alessandro Portale
2011-02-07 17:49:50 +01:00
parent 2899613b3b
commit 4413f9d621
8 changed files with 54 additions and 39 deletions

View File

@@ -124,20 +124,7 @@ void Html5App::handleCurrentProFileTemplateLine(const QString &line,
bool &commentOutNextLine) const
{
Q_UNUSED(commentOutNextLine)
if (line.contains(QLatin1String("# DEPLOYMENTFOLDERS"))) {
// Eat lines
QString nextLine;
while (!(nextLine = proFileTemplate.readLine()).isNull()
&& !nextLine.contains(QLatin1String("# DEPLOYMENTFOLDERS_END")))
{ }
if (nextLine.isNull())
return;
QStringList folders;
proFile << "folder_01.source = " << path(HtmlDirProFileRelative) << endl;
proFile << "folder_01.target = ." << endl;
folders.append(QLatin1String("folder_01"));
proFile << "DEPLOYMENTFOLDERS = " << folders.join(QLatin1String(" ")) << endl;
} else if (line.contains(QLatin1String("# INCLUDE_DEPLOYMENT_PRI"))) {
if (line.contains(QLatin1String("# INCLUDE_DEPLOYMENT_PRI"))) {
proFileTemplate.readLine(); // eats 'include(deployment.pri)'
}
}
@@ -225,6 +212,13 @@ QList<AbstractGeneratedFileInfo> Html5App::updateableFiles(const QString &mainPr
return result;
}
QList<DeploymentFolder> Html5App::deploymentFolders() const
{
QList<DeploymentFolder> result;
result.append(DeploymentFolder(path(HtmlDirProFileRelative), QLatin1String(".")));
return result;
}
const int Html5App::StubVersion = 10;
} // namespace Internal