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 /qmake/generators/symbian | |
parent | 95812dd991bdcc63c9a4c10d4cf32811aa0c413b (diff) | |
download | Qt-c58ad73ee53374a96dc67b8bf554f14cf718be2a.zip Qt-c58ad73ee53374a96dc67b8bf554f14cf718be2a.tar.gz Qt-c58ad73ee53374a96dc67b8bf554f14cf718be2a.tar.bz2 |
Whitespace, comment, and dead code cleanup for qmake
Diffstat (limited to 'qmake/generators/symbian')
-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 |
7 files changed, 121 insertions, 157 deletions
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 - |