diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-01 13:02:36 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-01 13:02:36 (GMT) |
commit | 0533cd3a773952490eb0e5686afb7b235799a13f (patch) | |
tree | a1f14fe42a51499666921d58a6a5b62f1f916d8e /qmake/generators | |
parent | 9c132451acc7fbed1611fd3676cceb26e815f50d (diff) | |
parent | e5974b024828578945bd4c349f5f87f82a635225 (diff) | |
download | Qt-0533cd3a773952490eb0e5686afb7b235799a13f.zip Qt-0533cd3a773952490eb0e5686afb7b235799a13f.tar.gz Qt-0533cd3a773952490eb0e5686afb7b235799a13f.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
mkspecs/features/symbian/application_icon.prf
src/sql/drivers/odbc/qsql_odbc.cpp
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/symbian/symbiancommon.cpp | 23 | ||||
-rw-r--r-- | qmake/generators/symbian/symbiancommon.h | 1 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 29 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.cpp | 4 |
4 files changed, 33 insertions, 24 deletions
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index c54fac7..46b8cf5 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -79,11 +79,7 @@ void SymbianCommonGenerator::init() fixedTarget = project->first("TARGET"); fixedTarget = generator->unescapeFilePath(fixedTarget); fixedTarget = removePathSeparators(fixedTarget); - if (project->first("MAKEFILE_GENERATOR") == "SYMBIAN_ABLD" - || project->first("MAKEFILE_GENERATOR") == "SYMBIAN_SBSV2") - removeEpocSpecialCharacters(fixedTarget); - else - removeSpecialCharacters(fixedTarget); + removeSpecialCharacters(fixedTarget); // This should not be empty since the mkspecs are supposed to set it if missing. uid3 = project->first("TARGET.UID3").trimmed(); @@ -131,18 +127,11 @@ bool SymbianCommonGenerator::containsStartWithItem(const QChar &c, const QString void SymbianCommonGenerator::removeSpecialCharacters(QString& str) { // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf - str.replace(QString("/"), QString("_")); - str.replace(QString("\\"), QString("_")); - str.replace(QString(" "), QString("_")); -} - -void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str) -{ - // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf - str.replace(QString("-"), QString("_")); - str.replace(QString(":"), QString("_")); - str.replace(QString("."), QString("_")); - removeSpecialCharacters(str); + QString underscore = QLatin1String("_"); + str.replace(QLatin1String("/"), underscore); + str.replace(QLatin1String("\\"), underscore); + str.replace(QLatin1String(" "), underscore); + str.replace(QLatin1String(":"), underscore); } QString romPath(const QString& path) diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h index 0b5f53d..5182021 100644 --- a/qmake/generators/symbian/symbiancommon.h +++ b/qmake/generators/symbian/symbiancommon.h @@ -82,7 +82,6 @@ protected: QString removePathSeparators(QString &file); void removeSpecialCharacters(QString& str); - void removeEpocSpecialCharacters(QString& str); void generatePkgFile(const QString &iconFile, bool epocBuild, const SymbianLocalizationList &symbianLocalizationList); diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index e6c9666..08d3370 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -83,6 +83,8 @@ #define VAR_CFLAGS "QMAKE_CFLAGS" #define VAR_LFLAGS "QMAKE_LFLAGS" +#define DEFINE_REPLACE_REGEXP "[^A-Z0-9_]" + QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) { static QString epocRootStr; @@ -165,11 +167,15 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) QString bldinfDefine = shortProFilename; bldinfDefine.append("_"); bldinfDefine.append(generate_uid(project->projectFile())); + bldinfDefine = bldinfDefine.toUpper(); + + // replace anything not alphanumeric with underscore + QRegExp replacementMask(DEFINE_REPLACE_REGEXP); + bldinfDefine.replace(replacementMask, QLatin1String("_")); bldinfDefine.prepend("BLD_INF_"); - removeEpocSpecialCharacters(bldinfDefine); - t << "#define " << bldinfDefine.toUpper() << endl << endl; + t << "#define " << bldinfDefine << endl << endl; } bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) @@ -892,13 +898,17 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy const QStringList &subdirs = project->values("SUBDIRS"); foreach(QString item, subdirs) { + bool fromFile = false; QString fixedItem; if (!project->isEmpty(item + ".file")) { fixedItem = project->first(item + ".file"); + fromFile = true; } else if (!project->isEmpty(item + ".subdir")) { fixedItem = project->first(item + ".subdir"); + fromFile = false; } else { fixedItem = item; + fromFile = item.endsWith(Option::pro_ext); } QString condition; @@ -907,9 +917,15 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy QFileInfo subdir(fileInfo(fixedItem)); QString relativePath = directory.relativeFilePath(fixedItem); - QString subdirFileName = subdir.completeBaseName(); - QString fullProName = subdir.absoluteFilePath();; + QString fullProName = subdir.absoluteFilePath(); QString bldinfFilename; + QString subdirFileName; + + if (fromFile) { + subdirFileName = subdir.completeBaseName(); + } else { + subdirFileName = subdir.fileName(); + } if (subdir.isDir()) { // Subdir is a regular project @@ -931,7 +947,10 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy QString uid = generate_uid(fullProName); QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid; bldinfDefine = bldinfDefine.toUpper(); - removeEpocSpecialCharacters(bldinfDefine); + + // replace anything not alphanumeric with underscore + QRegExp replacementMask(DEFINE_REPLACE_REGEXP); + bldinfDefine.replace(replacementMask, QLatin1String("_")); if (!condition.isEmpty()) t << "#if defined(" << condition << ")" << endl; diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 5729e26..b582257 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -190,6 +190,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "QMAKE = " << var("QMAKE_QMAKE") << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; + t << "DEL_TREE = " << var("QMAKE_DEL_TREE") << endl; t << "MOVE = " << var("QMAKE_MOVE") << endl; t << "CHK_DIR_EXISTS = " << var("QMAKE_CHK_DIR_EXISTS") << endl; t << "MKDIR = " << var("QMAKE_MKDIR") << endl; @@ -329,7 +330,8 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool // Note: EXTENSION_CLEAN will get called many times when doing reallyclean // This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp. t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl; - generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_TREE"), "", "", ""); + generateCleanCommands(t, dirsToClean, "$(DEL_TREE)", "", "", ""); + generateCleanCommands(t, project->values("QMAKE_CLEAN"), "$(DEL_FILE)", "", "", ""); t << endl; t << PRE_TARGETDEPS_TARGET ":" |