diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-08-04 08:48:18 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2009-08-04 08:48:18 (GMT) |
commit | c58ad73ee53374a96dc67b8bf554f14cf718be2a (patch) | |
tree | ccc89d3a22c1554877dc39a29c1e13a8d5c99e2b | |
parent | 95812dd991bdcc63c9a4c10d4cf32811aa0c413b (diff) | |
download | Qt-c58ad73ee53374a96dc67b8bf554f14cf718be2a.zip Qt-c58ad73ee53374a96dc67b8bf554f14cf718be2a.tar.gz Qt-c58ad73ee53374a96dc67b8bf554f14cf718be2a.tar.bz2 |
Whitespace, comment, and dead code cleanup for qmake
-rw-r--r-- | qmake/Makefile.win32 | 19 | ||||
-rw-r--r-- | qmake/Makefile.win32-g++ | 10 | ||||
-rw-r--r-- | qmake/Makefile.win32-g++-sh | 8 | ||||
-rw-r--r-- | qmake/Makefile.win32-mwc | 8 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/metamakefile.cpp | 86 | ||||
-rw-r--r-- | qmake/generators/symbian/initprojectdeploy_symbian.cpp | 5 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 226 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.h | 17 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.cpp | 12 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.h | 6 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.cpp | 7 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.h | 5 | ||||
-rw-r--r-- | qmake/project.cpp | 10 | ||||
-rw-r--r-- | qmake/qmake.pri | 4 | ||||
-rw-r--r-- | qmake/qpopen.cpp | 3 |
16 files changed, 176 insertions, 252 deletions
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 54c2872..3f4f8d4 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -86,11 +86,11 @@ CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION QTOBJS= \ qbitarray.obj \ qbuffer.obj \ - qcryptographichash.obj \ + qcryptographichash.obj \ qfsfileengine.obj \ qfsfileengine_iterator.obj \ qbytearray.obj \ - qvsnprintf.obj \ + qvsnprintf.obj \ qbytearraymatcher.obj \ qdatetime.obj \ qdir.obj \ @@ -107,7 +107,7 @@ QTOBJS= \ qlistdata.obj \ qlinkedlist.obj \ qlocale.obj \ - qmalloc.obj \ + qmalloc.obj \ qmap.obj \ qregexp.obj \ qstring.obj \ @@ -119,9 +119,9 @@ QTOBJS= \ qsettings.obj \ qlibraryinfo.obj \ qvariant.obj \ - qurl.obj \ + qurl.obj \ qsettings_win.obj \ - qmetatype.obj \ + qmetatype.obj \ qnumeric.obj \ qscriptasm.obj \ qscriptast.obj \ @@ -179,7 +179,7 @@ clean:: -del qfsfileengine.obj -del qfsfileengine_iterator.obj -del qbytearray.obj - -del qvsnprintf.obj + -del qvsnprintf.obj -del qbytearraymatcher.obj -del qdatetime.obj -del qdir.obj @@ -207,9 +207,9 @@ clean:: -del qsettings.obj -del qlibraryinfo.obj -del qvariant.obj - -del qurl.obj + -del qurl.obj -del qsettings_win.obj - -del qmetatype.obj + -del qmetatype.obj -del project.obj -del main.obj -del makefile.obj @@ -424,6 +424,7 @@ qmap.obj: $(SOURCE_PATH)\src\corelib\tools\qmap.cpp qunicodetables.obj: $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp + makefile.obj: $(SOURCE_PATH)/qmake/generators\makefile.cpp $(CXX) $(CXXFLAGS) generators\makefile.cpp @@ -464,7 +465,7 @@ symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp - $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp + $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp md5.obj: $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index dd65145..03ca6dd 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -19,13 +19,13 @@ CFLAGS = -c -o$@ -O \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ - -I$(BUILD_PATH)/include/QtScript \ + -I$(BUILD_PATH)/include/QtScript \ -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ - -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ - -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DQT_BOOTSTRAPPED + -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ + -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_BOOTSTRAPPED CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = -lole32 -luuid @@ -50,7 +50,7 @@ QTOBJS= \ qbitarray.o \ qbuffer.o \ qbytearray.o \ - qcryptographichash.o \ + qcryptographichash.o \ qvsnprintf.o \ qbytearraymatcher.o \ qconfig.o \ diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 646815b..bd1b8b5 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -19,13 +19,13 @@ CFLAGS = -c -o$@ -O \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ - -I$(BUILD_PATH)/include/QtScript \ + -I$(BUILD_PATH)/include/QtScript \ -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ - -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ - -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DQT_BOOTSTRAPPED + -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ + -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_BOOTSTRAPPED CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = -lole32 -luuid diff --git a/qmake/Makefile.win32-mwc b/qmake/Makefile.win32-mwc index 08b6c49..b3b1b71 100644 --- a/qmake/Makefile.win32-mwc +++ b/qmake/Makefile.win32-mwc @@ -14,7 +14,7 @@ endif CXX = mwccsym2 CFLAGS = -gccinc \ -w on -w nonotused -w nonotinlined -w noimplicit -w nopadding -w noemptydecl \ - -w nounusedexpr -w nopossible -c -o $@ -O \ + -w nounusedexpr -w nopossible -c -o $@ -O \ -I. -Igenerators -Igenerators\unix \ -Igenerators\win32 -Igenerators\mac \ -Igenerators\symbian \ @@ -23,8 +23,8 @@ CFLAGS = -gccinc \ -I$(BUILD_PATH)\src\corelib\global \ -I$(SOURCE_PATH)\mkspecs\win32-mwc \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ - -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \ - -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \ + -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ -DQT_NO_LIBRARY -I$(BUILD_PATH)\include\QtScript \ -I$(SOURCE_PATH)\corelib\xml -DQT_BOOTSTRAPPED @@ -52,7 +52,7 @@ QTOBJS= \ qbitarray.o \ qbuffer.o \ qbytearray.o \ - qcryptographichash.o \ + qcryptographichash.o \ qvsnprintf.o \ qbytearraymatcher.o \ qconfig.o \ diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 5eaa39f..345f999 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -275,7 +275,7 @@ MakefileGenerator::initOutPaths() int slash = path.lastIndexOf(Option::dir_sep); if(slash != -1) { path = path.left(slash); - // Make out path only if it does not contains makefile variables + // Make out path only if it does not contain makefile variables if(!path.contains("${")) if(path != "." && !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir))) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 63b0f17..0b8fa17 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -420,8 +420,8 @@ SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator() subs.clear(); } -class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator { - +class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator +{ public: SymbianSubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : SubdirsMetaMakefileGenerator(p, n, op) { } virtual ~SymbianSubdirsMetaMakefileGenerator(); @@ -441,29 +441,23 @@ protected: private: QString cleanFromSpecialCharacters(QString& str); - }; QMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpPaths; QMultiMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpDependency; -QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth) { - +QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth) +{ QStringList list; - // printf("Entering recursion mmpFilename = %s and depth = %d \n", qPrintable(mmpFilename), recursionDepth); - QList<QString> values = mmpDependency.values(mmpFilename); if(recursionDepth < 0) { - // special case - // just first dependency level + // special case; just first dependency level list = values; return list; - } if(values.size() == 0) { - //reached recursion END condition if(recursionDepth == 0) { --recursionDepth; @@ -477,16 +471,13 @@ QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFi } else { recursionDepth++; for (int i = 0; i < values.size(); ++i) { - QString current = values.at(i); - QStringList tailList = getDependencyList(current, recursionDepth); - for(int j = 0; j < tailList.size(); ++j) { - //QString path = mmpFilename + tailList.at(j); - QString path = tailList.at(j); - list.append(path); - //printf("MMPDEPENDENCY: %s\n", path.toAscii().data()); - }// for(int j = 0; j < values.size(); ++j) - //list.append(current); - } // for (int i = 0; i < values.size(); ++i) + QString current = values.at(i); + QStringList tailList = getDependencyList(current, recursionDepth); + for(int j = 0; j < tailList.size(); ++j) { + QString path = tailList.at(j); + list.append(path); + } + } if(recursionDepth > 0) { //for mmp somewhere in middle @@ -495,15 +486,17 @@ QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFi recursionDepth--; return list; } - } + SymbianSubdirsMetaMakefileGenerator::~SymbianSubdirsMetaMakefileGenerator() { } -bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd) { +bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd) +{ return SubdirsMetaMakefileGenerator::write(oldpwd); } -QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str) { +QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str) +{ QString tmp = str; tmp.replace(QString("/"), QString("_")); @@ -515,26 +508,14 @@ QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& return tmp; } -bool SymbianSubdirsMetaMakefileGenerator::init() { - +bool SymbianSubdirsMetaMakefileGenerator::init() +{ if(init_flag) return false; init_flag = true; - /* - Not neccessary as it was - causing second pass through - subdir elements - - SubdirsMetaMakefileGenerator::init(); - */ - - /* - if we are here then we have template = subdirs - - so... go for it ... - */ + // If we are here then we have template == subdirs Option::recursive = true; @@ -577,7 +558,6 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { if(subdir.isDir()) { subdir = QFileInfo(subdir.filePath() + "/" + subdir.fileName() + Option::pro_ext); childMmpFilename = subdir.fileName(); - // TODO: create Option::mmp_ext childMmpFilename = subdir.absoluteFilePath(); childMmpFilename.replace(Option::pro_ext, QString("")); childMmpFilename.append(".mmp"); @@ -599,7 +579,7 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { if(subdir.isRelative() && old_output_dir != oldpwd) { sub->output_dir = old_output_dir + "/" + subdir.path(); printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData()); - } else { //what about shadow builds? + } else { sub->output_dir = sub->input_dir; printf("Reading %s\n", subdir.absoluteFilePath().toLatin1().constData()); } @@ -654,10 +634,8 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { Subdir *self = new Subdir; self->input_dir = qmake_getpwd(); - // to fully expand find all dependencies - // do as recursion, then - // insert result - // as subdirs data in project + // To fully expand find all dependencies: + // Do as recursion, then insert result as subdirs data in project QString newpwd = qmake_getpwd(); if(!newpwd.endsWith('/')) newpwd += '/'; @@ -667,7 +645,7 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { mmpFilename.prepend(newpwd); mmpFilename = mmpFilename.append(".mmp"); - // map mmpfile to its absolut filepath + // map mmpfile to its absolute filepath mmpPaths.insert(mmpFilename, newpwd); QStringList directDependencyList = getDependencyList(mmpFilename, -1); @@ -676,27 +654,14 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { } QStringList dependencyList = getDependencyList(mmpFilename, 0); -/* - printf("\n \n PRINTING DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data()); - // print it for debug - for(int i = 0; i < dependencyList.size(); ++i) { - printf("FINAL MMP DEPENDENCIES: %s\n", dependencyList.at(i).toAscii().data()); - } - printf("\n \n"); - printf("\n \n PRINTING DIRECT DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data()); - // print it for debug - for(int i = 0; i < directDependencyList.size(); ++i) { - printf("DIRECT MMP DEPENDENCIES: %s\n", directDependencyList.at(i).toAscii().data()); - } - printf("\n \n"); -*/ self->output_dir = Option::output_dir; if(!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir())) self->output_file = Option::output.fileName(); self->makefile = new BuildsMetaMakefileGenerator(project, name, false); self->makefile->init(); subs.append(self); + return true; } @@ -714,7 +679,6 @@ QStringList SymbianSubdirsMetaMakefileGenerator::calculateRelativePaths(QString mmpRelativePaths.append(childDir); else directory.relativeFilePath(relativePath); - //mmpRelativePaths.append(directory.relativeFilePath(childDir) + "/" + mmpChildren.at(i)); } } return mmpRelativePaths; diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 22e4aad..8e3e20b 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -118,9 +118,7 @@ void initProjectDeploySymbian(QMakeProject* project, } QString deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:"); - // foreach item in DEPLOYMENT foreach(QString item, project->values("DEPLOYMENT")) { - // get item.path QString devicePath = project->first(item + ".path"); if (!deployBinaries && !devicePath.isEmpty() @@ -172,7 +170,6 @@ void initProjectDeploySymbian(QMakeProject* project, continue; } - // foreach d in item.sources foreach(QString source, project->values(item + ".sources")) { source = Option::fixPathToLocalOS(source); QString nameFilter; @@ -216,7 +213,7 @@ void initProjectDeploySymbian(QMakeProject* project, QDirIterator iterator(searchPath, QStringList() << nameFilter , QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks , dirSearch ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags ); - // foreach dirIterator-entry in d + while(iterator.hasNext()) { iterator.next(); QFileInfo iteratorInfo(iterator.filePath()); diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index c842b0e..1f22c70 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -146,7 +146,8 @@ QString SymbianMakefileGenerator::canonizePath(const QString& origPath) SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } SymbianMakefileGenerator::~SymbianMakefileGenerator() { } -void SymbianMakefileGenerator::writeHeader(QTextStream &t) { +void SymbianMakefileGenerator::writeHeader(QTextStream &t) +{ t << "// ============================================================================" << endl; t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl; t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; @@ -155,13 +156,10 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) { t << "// * user." << endl; t << "// * Project: " << fileFixify(project->projectFile()) << endl; t << "// * Template: " << var("TEMPLATE") << endl; - //if(!project->isActiveConfig("build_pass")) - // t << "// = Command: " << build_args().replace("$(QMAKE)", - // (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE"))) << endl; t << "// ============================================================================" << endl; t << endl; - // defining define for bld.inf + // Defining define for bld.inf QString shortProFilename = project->projectFile(); shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); @@ -177,7 +175,8 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) { t << "#define " << bldinfDefine.toUpper() << endl << endl; } -bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) { +bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) +{ writeHeader(t); QString numberOfIcons; @@ -268,7 +267,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) { return true; } -bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile) { +bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile) +{ QString build = ( config == "udeb" ) ? "debug" : "release"; QString pkgFilename = QString("%1_%2-%3.%4") .arg(fileInfo(project->projectFile()).completeBaseName()) @@ -281,15 +281,15 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS generatedFiles << pkgFile.fileName(); - // header info + // Header info QTextStream t(&pkgFile); t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString(Qt::ISODate)) << endl; t << "; This file is generated by qmake and should not be modified by the user" << endl; t << ";" << endl << endl; - + // Construct QStringList from pkg_prerules since we need search it before printed to file QStringList rawPkgPreRules; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { + 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 @@ -300,20 +300,20 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS foreach(QString pkgrule, pkgrulesValue) { rawPkgPreRules << pkgrule; } - } + } } - } + } // Apply some defaults if specific data does not exist in PKG pre-rules - - if(!containsStartWithItem('&', rawPkgPreRules)) { + + if(!containsStartWithItem('&', rawPkgPreRules)) { // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) t << "; Language" << endl; t << "&EN" << endl << endl; } else { // 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"); } // name of application, UID and version @@ -321,39 +321,39 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS int last = applicationName.lastIndexOf(QLatin1Char('/')); applicationName = applicationName.mid( last == -1 ? 0 : last+1 ); QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); - - if(!containsStartWithItem('#', rawPkgPreRules)) { + + if(!containsStartWithItem('#', rawPkgPreRules)) { t << "; SIS header: name, uid, version" << endl; t << QString("#{\"%1\"},(%2),%3").arg(applicationName).arg(uid3).arg(applicationVersion) << endl << endl; } // Localized vendor name if(!containsStartWithItem('%', rawPkgPreRules)) { - t << "; Localised Vendor name" << endl; - t << "%{\"Vendor\"}" << endl << endl; + t << "; Localised Vendor name" << endl; + t << "%{\"Vendor\"}" << endl << endl; } - + // Unique vendor name - if(!containsStartWithItem(':', rawPkgPreRules)) { + if(!containsStartWithItem(':', rawPkgPreRules)) { t << "; Unique Vendor name" << endl; t << ":\"Vendor\"" << endl << endl; } // PKG pre-rules - these are added before actual file installations i.e. SISX package body if(rawPkgPreRules.size()) { - t << "; Manual PKG pre-rules from PRO files" << endl; + t << "; Manual PKG pre-rules from PRO files" << endl; foreach(QString item, rawPkgPreRules) { t << item << endl; } - t << endl; - } + t << endl; + } - // install paths on the phone *** should be dynamic at some point + // Install paths on the phone *** should be dynamic at some point QString installPathBin = "!:\\sys\\bin"; QString installPathResource = "!:\\resource\\apps"; QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; - // find location of builds + // Find location of builds QString epocReleasePath = QString("%1epoc32/release/%2/%3") .arg(epocRoot()) .arg(compiler) @@ -409,15 +409,15 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS .arg(QString(depList.at(i).from).replace('\\','/')) .arg(depList.at(i).to) << endl; } - t << endl; - - // PKG post-rules - these are added after actual file installations i.e. SISX package body + t << endl; + + // PKG post-rules - these are added after actual file installations i.e. SIS package body t << "; Manual PKG post-rules from PRO files" << endl; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { + foreach(QString deploymentItem, project->values("DEPLOYMENT")) { foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) { 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 + // This is convenience for defining single line statements if (pkgrulesValue.isEmpty()){ t << pkgrulesItem << endl; } else { @@ -425,9 +425,9 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS t << pkgrule << endl; } } - t << endl; + t << endl; } - } + } return true; } @@ -444,7 +444,8 @@ bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStri return result; } -bool SymbianMakefileGenerator::writeCustomDefFile() { +bool SymbianMakefileGenerator::writeCustomDefFile() +{ if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { // Create custom def file for plugin QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL)); @@ -482,10 +483,7 @@ bool SymbianMakefileGenerator::writeCustomDefFile() { void SymbianMakefileGenerator::init() { MakefileGenerator::init(); -/* - DUMP_VAR("GENERATED_SOURCES"); -*/ - // fixing again !!! + if(0 != project->values("QMAKE_PLATFORM").size()) platform = varGlue("QMAKE_PLATFORM", "", " ", ""); @@ -502,29 +500,25 @@ void SymbianMakefileGenerator::init() // .mmp initMmpVariables(); - // UID1 - uid1 = generateUID1(); - - // check TARGET.UID2 and TARGET.UID3 presence + // Check TARGET.UID2 and TARGET.UID3 presence if(0 != project->values("TARGET.UID3").size()) { uid3 = project->first("TARGET.UID3"); } else { uid3 = generateUID3(); } - // some fix if((project->values("TEMPLATE")).contains("app")) targetType = "exe"; else if((project->values("TEMPLATE")).contains("lib")) { - // check CONFIG to see if we are to build staticlib or dll + // Check CONFIG to see if we are to build staticlib or dll if(project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static")) targetType = "staticlib"; else if (project->values("CONFIG").contains("plugin")) targetType = "plugin"; - else // for now it will be default + else targetType = "dll"; } - else // fix + else targetType = "subdirs"; if(0 != project->values("TARGET.UID2").size()) { @@ -534,11 +528,10 @@ void SymbianMakefileGenerator::init() } else { if(getTargetExtension() == "exe") { if(project->values("QT").contains("gui", Qt::CaseInsensitive)) { - // exe and also gui + // exe and gui -> uid2 needed uid2 = "0x100039CE"; } else { - // exe but not gui.. uid2 is ignored anyway - // set it to 0 + // exe but not gui: uid2 is ignored anyway -> set it to 0 uid2 = "0"; } } else if(getTargetExtension() == "dll" || getTargetExtension() == "lib") { @@ -563,7 +556,8 @@ void SymbianMakefileGenerator::init() } } -QString SymbianMakefileGenerator::getTargetExtension() { +QString SymbianMakefileGenerator::getTargetExtension() +{ QString ret; if(targetType.compare("exe", Qt::CaseInsensitive) == 0 || targetType.compare("app", Qt::CaseInsensitive) == 0) { ret.append("exe"); @@ -572,41 +566,30 @@ QString SymbianMakefileGenerator::getTargetExtension() { } else if (targetType.compare("dll", Qt::CaseInsensitive) == 0 || targetType.compare("plugin", Qt::CaseInsensitive) == 0) { ret.append("dll"); } else if (targetType.compare("subdirs", Qt::CaseInsensitive) == 0) { - // just fix ret.append("subdirs"); } else { - // if nothing said then assume "exe" + // If nothing else set, default to exe ret.append("exe"); } return ret; } -bool SymbianMakefileGenerator::isConfigSetToSymbian() { +bool SymbianMakefileGenerator::isConfigSetToSymbian() +{ return project->values("CONFIG").contains("symbian", Qt::CaseInsensitive); } -QString SymbianMakefileGenerator::generateUID1() { - // just for now - return QString(""); -} - -QString SymbianMakefileGenerator::generateUID2() { - // standard stuff; picked form symbian - // later meybe read from somewhere - return QString(""); -} - -QString SymbianMakefileGenerator::generateUID3() { - +QString SymbianMakefileGenerator::generateUID3() +{ QString target = project->first("TARGET"); QString currPath = qmake_getpwd(); target.prepend("/").prepend(currPath); return generate_test_uid(target); - } -bool SymbianMakefileGenerator::initMmpVariables() { +bool SymbianMakefileGenerator::initMmpVariables() +{ QStringList sysincspaths; QStringList srcincpaths; QStringList srcpaths; @@ -655,9 +638,7 @@ bool SymbianMakefileGenerator::initMmpVariables() { appendIfnotExist(sysincspaths, includepath + QString("/" QT_EXTRA_INCLUDE_DIR)); } - // remove duplicate include path entries - // convert to native directory separators - // to check if includepaths are same + // Remove duplicate include path entries QStringList temporary; for(int i = 0; i < sysincspaths.size(); ++i) { QString origPath = sysincspaths.at(i); @@ -671,7 +652,7 @@ bool SymbianMakefileGenerator::initMmpVariables() { if(origPathInfo.absoluteFilePath() == tmpPathInfo.absoluteFilePath()) { bFound = true; if(!tmpPathInfo.isRelative() && origPathInfo.isRelative()) { - // we keep the relative notation + // We keep the relative notation temporary.removeOne(tmpPath); temporary << origPath; } @@ -691,8 +672,8 @@ bool SymbianMakefileGenerator::initMmpVariables() { return true; } -bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) { - +bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) +{ QStringList tmpStringList; for(int i = 0; i < stringList.size(); ++i) { @@ -708,7 +689,8 @@ bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) return true; } -bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t){ +bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t) +{ t << "// ==============================================================================" << endl; t << "// Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; @@ -726,8 +708,6 @@ bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb if(ft.open(QIODevice::WriteOnly)) { generatedFiles << ft.fileName(); - //printf("WRITING: %s \n", qPrintable(filename)); - QTextStream t(&ft); writeMmpFileHeader(t); @@ -775,8 +755,8 @@ bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb return true; } -bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) { - +bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) +{ t << endl; if(isConfigSetToSymbian()) @@ -804,32 +784,34 @@ bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) { +bool SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) +{ t << "MACRO" << "\t\t" << value << endl; return true; } -bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) +{ if(getTargetExtension() == "exe") { t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << "\n"; if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) t << "TARGETTYPE" << "\t\t" << "STDEXE" << endl; else t << "TARGETTYPE" << "\t\t" << "EXE" << endl; - } else if (getTargetExtension() == "dll"){ + } else if (getTargetExtension() == "dll"){ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".dll")) << "\n"; if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) t << "TARGETTYPE" << "\t\t" << "STDDLL" << endl; else t << "TARGETTYPE" << "\t\t" << "DLL" << endl; - } else if (getTargetExtension() == "lib"){ + } else if (getTargetExtension() == "lib"){ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".lib")) << "\n"; if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) t << "TARGETTYPE" << "\t\t" << "STDLIB" << endl; else t << "TARGETTYPE" << "\t\t" << "LIB" << endl; - } else { + } else { printf("unexpected target and targettype %s\n", getTargetExtension().toAscii().data()); } @@ -846,7 +828,7 @@ bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { t << "SECUREID" << "\t\t" << uid3 << endl; } - // default value used from mkspecs..qconfig.h is 0 + // default value used from mkspecs is 0 if(0 != project->values("TARGET.VID").size()) { t << "VENDORID" << "\t\t" << project->values("TARGET.VID").join(" ") << endl; } @@ -861,7 +843,7 @@ bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { t << "EPOCALLOWDLLDATA" << endl; if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { - // use custom def file for Qt plugins + // Use custom def file for Qt plugins t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl; } @@ -872,12 +854,11 @@ bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { /* - Application registration resource files - should be installed to the - + Application registration resource files should be installed to the \private\10003a3f\import\apps directory. */ -bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) { +bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) +{ if((getTargetExtension() == "exe") && !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) { QString target = escapeFilePath(fileFixify(project->first("TARGET"))); @@ -897,15 +878,10 @@ bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP<< endl; t << "END" << endl << endl; - // now append extension QString regTarget = target; regTarget.append("_reg.rss"); - // must state SOURCEPATH for resources - // relative placement (relative to dir where .mmp located) - // absolute placement (!RELATIVE! to EPOCROOT dir) - - t << "SOURCEPATH\t\t\t. " << endl; + t << "SOURCEPATH\t\t\t." << endl; t << "START RESOURCE\t\t" << regTarget << endl; if (isForSymbianSbsv2()) t << "DEPENDS " << target << ".rsg" << endl; @@ -915,7 +891,8 @@ bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL return true; } -bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) +{ QDir current = QDir::current(); @@ -932,14 +909,16 @@ bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) +{ writeMmpFileSystemIncludePart(t); return true; } -bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) +{ QStringList &libs = project->values("LIBS"); libs << project->values("QMAKE_LIBS"); @@ -947,8 +926,7 @@ bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { for(int i = 0; i < libs.size(); ++i) { QString lib = libs.at(i); - // The -L flag is uninteresting, since all symbian libraries exist in the - // same directory. + // The -L flag is uninteresting, since all symbian libraries exist in the same directory. if(lib.startsWith("-l")) { lib.remove(0,2); QString mmpStatement; @@ -961,7 +939,7 @@ bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { } else { // Hacky way to find out what kind of library it is. Check the // ARMV5 build directory for library type. We default to shared - // library, since that is probably more common. + // library, since that is more common. QString udebStaticLibLocation(epocRoot()); QString urelStaticLibLocation(udebStaticLibLocation); udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib); @@ -981,7 +959,8 @@ bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) +{ if(0 != project->first("TARGET.CAPABILITY").size()) { QStringList &capabilities = project->values("TARGET.CAPABILITY"); t << "CAPABILITY" << "\t\t"; @@ -999,7 +978,8 @@ bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) +{ QString cw, armcc; if(0 != project->values("QMAKE_CXXFLAGS.CW").size()) { @@ -1045,13 +1025,13 @@ bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) { t << "OPTION" << '\t' << " CW " << cw << endl; if (!armcc.isEmpty()) t << "OPTION" << '\t' << " ARMCC "<< armcc << endl; - // others to come t << endl; return true; } -bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) +{ QString applicationVersion = project->first("VERSION"); QStringList verNumList = applicationVersion.split('.'); uint major = 0; @@ -1088,7 +1068,8 @@ bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) +{ foreach(QString item, project->values("MMP_RULES")) { t << endl; // If there is no stringlist defined for a rule, use rule name directly @@ -1104,7 +1085,8 @@ bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension) { +bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension) +{ // Read user defined bld inf rules QMap<QString, QStringList> userBldInfRules; for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { @@ -1146,7 +1128,7 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy removeDuplicatedStrings(mmpProjects); removeDuplicatedStrings(shadowProjects); - // go in reverse order ... as that is the way how I build the list + // Go in reverse order as that is the way how we build the list QListIterator<QString> iT(mmpProjects); iT.toBack(); while(iT.hasPrevious()) { @@ -1167,10 +1149,9 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy relativePath = directory.relativeFilePath(fullProFilename); bldinfFilename = BLD_INF_FILENAME "." + cleanMmpName; if(relativePath.contains("/")) { - // shadow .pro not in same - // directory as parent .pro + // Shadow .pro not in same directory as parent .pro if(relativePath.startsWith("..")) { - // shadow .pro out of parent .pro + // Shadow .pro out of parent .pro relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString("")); bldinfFilename.prepend("/").prepend(relativePath); } else { @@ -1178,11 +1159,10 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy bldinfFilename.prepend("/").prepend(relativePath); } } else { - // shadow .pro and parent .pro in same directory + // Shadow .pro and parent .pro in same directory bldinfFilename.prepend("./"); } } else { // regular project - // calc relative path QDir directory(currentPath); relativePath = directory.relativeFilePath(fullProFilename); relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString("")); @@ -1261,7 +1241,8 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy return true; } -bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &userItems) { +bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &userItems) +{ QString filename(appName); filename.append("_reg.rss"); QFile ft(filename); @@ -1296,7 +1277,8 @@ bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &us return true; } -bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfIcons, QString &iconFile) { +bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfIcons, QString &iconFile) +{ QString filename(appName); filename.append(".rss"); QFile ft(filename); @@ -1340,7 +1322,8 @@ bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfI return true; } -bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbianLangCodes) { +bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbianLangCodes) +{ QString filename(appName); filename.append(".loc"); QFile ft(filename); @@ -1374,7 +1357,8 @@ bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbi return true; } -void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) { +void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) +{ for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { if (it.key().startsWith(RSS_RULES_BASE)) { QString newKey = it.key().mid(sizeof(RSS_RULES_BASE)-1); @@ -1455,7 +1439,8 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico } } -QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() { +QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() +{ QStringList tsfiles; QStringList symbianLangCodes; tsfiles << project->values("TRANSLATIONS"); @@ -1476,7 +1461,8 @@ QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() { return symbianLangCodes; } -void SymbianMakefileGenerator::fillQt2S60LangMapTable() { +void SymbianMakefileGenerator::fillQt2S60LangMapTable() +{ qt2S60LangMapTable.reserve(170); // 165 items at time of writing. qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian // qt2S60LangMapTable.insert("om", "SC"); //Afan // diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index ba49118..3bf9f1d 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -46,25 +46,16 @@ QT_BEGIN_NAMESPACE -// In the Qt evaluation and educational version, we have a postfix in the -// library name (e.g. qtmteval301.dll). QTDLL_POSTFIX is used for this. -// A script modifies these lines when building eval/edu version, so be careful -// when changing them. -#ifndef QTDLL_POSTFIX -#define QTDLL_POSTFIX "" -#endif - #define BLD_INF_FILENAME "bld.inf" #define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t" #define QT_EXTRA_INCLUDE_DIR "tmp" -class SymbianMakefileGenerator : public MakefileGenerator { - +class SymbianMakefileGenerator : public MakefileGenerator +{ protected: QString platform; - QString uid1; QString uid2; QString uid3; QString privateDirUid; @@ -92,8 +83,6 @@ protected: QString getTargetExtension(); bool isConfigSetToSymbian(); - QString generateUID1(); - QString generateUID2(); QString generateUID3(); bool initMmpVariables(); @@ -150,8 +139,6 @@ public: SymbianMakefileGenerator(); ~SymbianMakefileGenerator(); - }; #endif // SYMMAKEFILE_H - diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index ccda9f2..17c365d 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -64,7 +64,6 @@ SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { } bool SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) { - QString gnuMakefileName = QLatin1String("Makefile_") + uid3; removeSpecialCharacters(gnuMakefileName); gnuMakefileName.append(".mk"); @@ -204,9 +203,9 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "endif" << endl; t << endl; t << "DEFINES" << '\t' << " = " - << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") - << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") - << varGlue("DEFINES","-D"," -D","") << endl; + << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") + << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") + << varGlue("DEFINES","-D"," -D","") << endl; t << "INCPATH" << '\t' << " = "; @@ -365,7 +364,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "\t-bldmake clean" << endl; t << endl; - // create execution target + // Create execution target if (debugPlatforms.contains("winscw") && getTargetExtension() == "exe") { t << "run:" << endl; t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl; @@ -391,7 +390,7 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t) t << "\t-echo Deploying changed files..." << endl; for (int i=0; i<depList.size(); ++i) { - // xcopy prompts for selecting file or directory if target doesn't exist, + // Xcopy prompts for selecting file or directory if target doesn't exist, // and doesn't provide switch to force file selection. It does provide dir forcing, though, // so strip the last part of the destination. t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\")+1) << "\"" << endl; @@ -425,4 +424,3 @@ void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool ad t << "gnumakefile " << gnuMakefileName << endl; } } - diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h index d323813..7de6510 100644 --- a/qmake/generators/symbian/symmake_abld.h +++ b/qmake/generators/symbian/symmake_abld.h @@ -46,8 +46,8 @@ QT_BEGIN_NAMESPACE -class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator { - +class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator +{ protected: // Inherited from parent @@ -62,8 +62,6 @@ public: SymbianAbldMakefileGenerator(); ~SymbianAbldMakefileGenerator(); - }; #endif // SYMMAKE_ABLD_H - diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 0266bac..34585e8 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -78,7 +78,9 @@ void SymbianSbsv2MakefileGenerator::exportFlm() if (QFile::copy(item.absoluteFilePath(), destInfo.absoluteFilePath())) generatedFiles << destInfo.absoluteFilePath(); else - fprintf(stderr, "Error: Could not copy '%s' -> '%s'\n", qPrintable(item.absoluteFilePath()), qPrintable(destInfo.absoluteFilePath())); + fprintf(stderr, "Error: Could not copy '%s' -> '%s'\n", + qPrintable(item.absoluteFilePath()), + qPrintable(destInfo.absoluteFilePath())); } } flmExportDone = true; @@ -354,8 +356,6 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t t << endl; - // ### TODO: Linux emulator (platsim?) deployment - // Write post link rules if(!project->isEmpty("QMAKE_POST_LINK")) { t << "START EXTENSION qt/qmake_post_link" << endl; @@ -418,4 +418,3 @@ void SymbianSbsv2MakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool a Q_UNUSED(t); Q_UNUSED(addDeploymentExtension); } - diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h index e55d177..caa491d 100644 --- a/qmake/generators/symbian/symmake_sbsv2.h +++ b/qmake/generators/symbian/symmake_sbsv2.h @@ -46,8 +46,8 @@ QT_BEGIN_NAMESPACE -class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator { - +class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator +{ protected: // Inherited from parent @@ -69,4 +69,3 @@ private: }; #endif // SYMMAKE_SBSV2_H - diff --git a/qmake/project.cpp b/qmake/project.cpp index 0a5e9a3..7c7044c 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -3339,26 +3339,24 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList // UIDs starting with 0xE are test UIDs in symbian -QString generate_test_uid(const QString& target) { +QString generate_test_uid(const QString& target) +{ QString tmp = generate_uid(target); tmp.replace(0,1,"E"); tmp.prepend("0x"); - // printf("generate_test_uid for %s is %s \n", qPrintable(target), qPrintable(tmp)); - return tmp; } // UIDs starting with 0xE are test UIDs in symbian -QString generate_uid(const QString& target) { - +QString generate_uid(const QString& target) +{ static QMap<QString, QString> targetToUid; QString tmp = targetToUid[target]; if(!tmp.isEmpty()) { - // printf("generate_uid for %s is %s \n", qPrintable(target), qPrintable(tmp)); return tmp; } diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 2304fab..f43d933 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -17,14 +17,14 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/symbian/symmake.cpp \ generators/symbian/symmake_abld.cpp \ generators/symbian/symmake_sbsv2.cpp \ - generators/symbian/initprojectdeploy_symbian.cpp + generators/symbian/initprojectdeploy_symbian.cpp # MWC does not provide an implementation of popen() so fake it. win32-mwc { SOURCES += qpopen.cpp \ } - + HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ generators/win32/winmakefile.h generators/projectgenerator.h \ diff --git a/qmake/qpopen.cpp b/qmake/qpopen.cpp index ebde035..7acff92 100644 --- a/qmake/qpopen.cpp +++ b/qmake/qpopen.cpp @@ -69,7 +69,6 @@ bool QPopen::init(const char *command, const char* /* mode */) // Ensure that the write handle to the child process's pipe for STDIN is not inherited. SetHandleInformation( childStdInW, HANDLE_FLAG_INHERIT, 0); - //TCHAR szCmdline[strlen(command)]=TEXT(command); TCHAR *szCmdLine = new TCHAR[strlen(command)+1]; strcpy(szCmdLine, command); @@ -126,7 +125,6 @@ int QPopen::fwrite(char* buffer, int maxBytes) return 0; } - int QPopen::fread(char* buffer, int maxBytes) { DWORD bytesRead; @@ -140,4 +138,3 @@ int QPopen::fread(char* buffer, int maxBytes) return 0; } - |