summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2010-03-24 10:15:34 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2010-03-24 10:47:36 (GMT)
commita2f2c87f320873d1968d931ad69a0f640c5545b1 (patch)
tree80a946d0f28922043c5e4d96b5ba3e039609e514 /qmake
parent6fc92ea90a078938ced596059981a120dc9ff57d (diff)
downloadQt-a2f2c87f320873d1968d931ad69a0f640c5545b1.zip
Qt-a2f2c87f320873d1968d931ad69a0f640c5545b1.tar.gz
Qt-a2f2c87f320873d1968d931ad69a0f640c5545b1.tar.bz2
Made it possible to define more than one language using pkg_prerules
The pkg statements were generated in invalid order if user used pkg_prerules to redefine languages supported by the pkg file. Also made it possible to override dependency statements autogenerated for Qt and QtWebkit, as these statements need to be user defined in case of multiple languages. Defining the following in .pro removes all dependencies from pkg rules: default_deployment.pkg_prerules -= \ pkg_depends_webkit \ pkg_depends_qt \ pkg_platform_dependencies Task-number: QTBUG-9279 Reviewed-by: Janne Anttila
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/symbian/symmake.cpp44
1 files changed, 32 insertions, 12 deletions
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index c6023b5..1470a12 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -322,17 +322,36 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);
// Construct QStringList from pkg_prerules since we need search it before printed to file
+ // Note: Though there can't be more than one language or header line, use stringlists
+ // in case user wants comments to go with the rules.
QStringList rawPkgPreRules;
+ QStringList languageRules;
+ QStringList headerRules;
foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) {
QStringList pkgrulesValue = project->values(pkgrulesItem);
// If there is no stringlist defined for a rule, use rule name directly
// This is convenience for defining single line mmp statements
if (pkgrulesValue.isEmpty()) {
- rawPkgPreRules << pkgrulesItem;
+ if (pkgrulesItem.startsWith("&"))
+ languageRules << pkgrulesItem;
+ else if (pkgrulesItem.startsWith("#"))
+ headerRules << pkgrulesItem;
+ else
+ rawPkgPreRules << pkgrulesItem;
} else {
- foreach(QString pkgrule, pkgrulesValue) {
- rawPkgPreRules << pkgrule;
+ if (containsStartWithItem('&', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ languageRules << pkgrule;
+ }
+ } else if (containsStartWithItem('#', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ headerRules << pkgrule;
+ }
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ rawPkgPreRules << pkgrule;
+ }
}
}
}
@@ -340,17 +359,17 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
// Apply some defaults if specific data does not exist in PKG pre-rules
- if (!containsStartWithItem('&', rawPkgPreRules)) {
+ if (languageRules.isEmpty()) {
// language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)
- QString languageCode = "; Language\n&EN\n\n";
- t << languageCode;
- tw << languageCode;
- } else {
+ languageRules << "; Language\n&EN\n\n";
+ } else if (headerRules.isEmpty()) {
// In case user defines langs, he must take care also about SIS header
- if (!containsStartWithItem('#', rawPkgPreRules))
- fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n");
+ fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n");
}
+ t << languageRules.join("\n") << endl;
+ tw << languageRules.join("\n") << endl;
+
// name of application, UID and version
QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n";
@@ -364,9 +383,10 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme
tw << installerSisHeader << endl;
}
- if (!containsStartWithItem('#', rawPkgPreRules)) {
+ if (headerRules.isEmpty())
t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
- }
+ else
+ t << headerRules.join("\n") << endl;
// Localized vendor name
QString vendorName;