summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-01-27 10:40:33 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-01-27 13:40:35 (GMT)
commit4ec245a3e75470186557d00b2383af3872a720b0 (patch)
tree41f26e8350cf3755b8e251d8bb4c789a30fedba8 /qmake
parent5c91e32a6238fd112a7282443214c8686cda51de (diff)
downloadQt-4ec245a3e75470186557d00b2383af3872a720b0.zip
Qt-4ec245a3e75470186557d00b2383af3872a720b0.tar.gz
Qt-4ec245a3e75470186557d00b2383af3872a720b0.tar.bz2
No longer replace dash and dot in TARGET with underscore in Symbian
There is no fundamental reason to not have dash or dot in binary names in Symbian, so do not replace them with underscore. One thing that doesn't work with a dot in the filename is launching an application via resources, so automatic resource generation is suppressed for applications that have a dot in filename portion of the TARGET value. Task-number: QTBUG-16888 Reviewed-by: axis
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp23
-rw-r--r--qmake/generators/symbian/symbiancommon.h1
-rw-r--r--qmake/generators/symbian/symmake.cpp31
3 files changed, 31 insertions, 24 deletions
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 2270c2e..96d7725 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 a2b567d..4f9f22d 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)
@@ -902,13 +908,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;
@@ -917,9 +927,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
@@ -941,7 +957,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;
@@ -1124,4 +1143,4 @@ QString SymbianMakefileGenerator::generateLocFileTarget(QTextStream& t, const QS
}
return locFile;
-} \ No newline at end of file
+}