diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-02 18:28:21 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-02 18:28:21 (GMT) |
commit | 330adc6b00d03f707ce7e2937e145c4414d3b109 (patch) | |
tree | a9f92f5bdd9f7d9a575e3df5fd78668c46394fe3 /qmake | |
parent | ba8892c1a833899c23703a5da1978cbfe7c92725 (diff) | |
parent | 39233f76647e166961c97b38d16f612076eeb9c3 (diff) | |
download | Qt-330adc6b00d03f707ce7e2937e145c4414d3b109.zip Qt-330adc6b00d03f707ce7e2937e145c4414d3b109.tar.gz Qt-330adc6b00d03f707ce7e2937e145c4414d3b109.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1:
Assistant examples: Fix missing QLatin1String.
Added Czech translations.
Webkit: Fix missing namespace.
qmake: subdirs template: make distclean target use QMAKE_DISTCLEAN
qmake: fix warnings
qmake: Remove macro and simplify string expression previously using it
qmake: use isActiveConfig() instead of hand-crafting comparisons
Fix missing namespace.
Assistant: Fix spelling mistakes.
Assistant: Use const references in foreach loops.
optimization: get rid of QString::fromUtf16() usage
document QString::fromUtf16() slowness
remove duplicated calculation of length
remove pointless conditionals
micro-optimization
optimize qhash()
Designer/uic/related examples: Fix source code scanning issues II.
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/makefile.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/makefiledeps.cpp | 34 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 33 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 3 | ||||
-rw-r--r-- | qmake/meta.cpp | 5 | ||||
-rw-r--r-- | qmake/option.cpp | 4 |
8 files changed, 46 insertions, 41 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 7424d1d..69e1d8a 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1824,11 +1824,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) cleans.append(files); } } - if(!cleans.isEmpty()) + if(!cleans.isEmpty()) { if (isForSymbian()) t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL"); else t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, ""); + } if(!wrote_clean_cmds) { for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, (*input), @@ -2535,6 +2536,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); if(!ofile.isEmpty()) t << "\t-$(DEL_FILE) " << ofile << endl; + t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); } else if(project->isActiveConfig("no_empty_targets")) { t << "\t" << "@cd ." << endl; } diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 40304a6..21e1273 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -397,7 +397,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) buffer = getBuffer(fst.st_size); for(int have_read = 0; (have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len)); - buffer_len += have_read); + buffer_len += have_read) ; QT_CLOSE(fd); } if(!buffer) @@ -418,22 +418,22 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) ++x; if(buffer_len >= x + 12 && !strncmp(buffer + x, "includehint", 11) && (*(buffer + x + 11) == ' ' || *(buffer + x + 11) == '>')) { - for(x += 11; *(buffer + x) != '>'; ++x); + for(x += 11; *(buffer + x) != '>'; ++x) ; int inc_len = 0; - for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len); + for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ; *(buffer + x + inc_len) = '\0'; inc = buffer + x; } else if(buffer_len >= x + 13 && !strncmp(buffer + x, "customwidget", 12) && (*(buffer + x + 12) == ' ' || *(buffer + x + 12) == '>')) { - for(x += 13; *(buffer + x) != '>'; ++x); //skip up to > + for(x += 13; *(buffer + x) != '>'; ++x) ; //skip up to > while(x < buffer_len) { - for(x++; *(buffer + x) != '<'; ++x); //skip up to < + for(x++; *(buffer + x) != '<'; ++x) ; //skip up to < x++; if(buffer_len >= x + 7 && !strncmp(buffer+x, "header", 6) && (*(buffer + x + 6) == ' ' || *(buffer + x + 6) == '>')) { - for(x += 7; *(buffer + x) != '>'; ++x); //skip up to > + for(x += 7; *(buffer + x) != '>'; ++x) ; //skip up to > int inc_len = 0; - for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len); + for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ; *(buffer + x + inc_len) = '\0'; inc = buffer + x; break; @@ -448,10 +448,10 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) for(x += 8; *(buffer + x) != '>'; ++x) { if(buffer_len >= x + 9 && *(buffer + x) == 'i' && !strncmp(buffer + x, "impldecl", 8)) { - for(x += 8; *(buffer + x) != '='; ++x); + for(x += 8; *(buffer + x) != '='; ++x) ; if(*(buffer + x) != '=') continue; - for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x); + for(++x; *(buffer+x) == '\t' || *(buffer+x) == ' '; ++x) ; char quote = 0; if(*(buffer+x) == '\'' || *(buffer+x) == '"') { quote = *(buffer + x); @@ -475,13 +475,13 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) } } int inc_len = 0; - for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len); + for(x += 1 ; *(buffer + x + inc_len) != '<'; ++inc_len) ; *(buffer + x + inc_len) = '\0'; inc = buffer + x; } } //read past new line now.. - for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x); + for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ; ++line_count; } else if(file->type == QMakeSourceFileInfo::TYPE_QRC) { } else if(file->type == QMakeSourceFileInfo::TYPE_C) { @@ -494,7 +494,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) ++x; if(buffer_len >= x) { if(*(buffer+x) == '/') { //c++ style comment - for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x); + for(; x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ; beginning = 1; } else if(*(buffer+x) == '*') { //c style comment for(++x; x < buffer_len; ++x) { @@ -558,7 +558,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) *(buffer+x+keyword_len) != '_') { for(x+=keyword_len; //skip spaces after keyword x < buffer_len && (*(buffer+x) == ' ' || *(buffer+x) == '\t'); - x++); + x++) ; break; } else if(qmake_endOfLine(*(buffer+x+keyword_len))) { x += keyword_len-1; @@ -579,7 +579,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) x++; int inc_len; - for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len); + for(inc_len = 0; *(buffer + x + inc_len) != term && !qmake_endOfLine(*(buffer + x + inc_len)); ++inc_len) ; *(buffer + x + inc_len) = '\0'; inc = buffer + x; x += inc_len; @@ -594,7 +594,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) int msg_len; for(msg_len = 0; (term && *(buffer + x + msg_len) != term) && - !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len); + !qmake_endOfLine(*(buffer + x + msg_len)); ++msg_len) ; *(buffer + x + msg_len) = '\0'; debug_msg(0, "%s:%d %s -- %s", file->file.local().toLatin1().constData(), line_count, keyword, buffer+x); x += msg_len; @@ -706,7 +706,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file) buffer = getBuffer(fst.st_size); for(int have_read = buffer_len = 0; (have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len)); - buffer_len += have_read); + buffer_len += have_read) ; QT_CLOSE(fd); } @@ -720,7 +720,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file) ++x; if(buffer_len >= x) { if(*(buffer + x) == '/') { //c++ style comment - for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x); + for(;x < buffer_len && !qmake_endOfLine(*(buffer + x)); ++x) ; } else if(*(buffer + x) == '*') { //c style comment for(++x; x < buffer_len; ++x) { if(*(buffer + x) == 't' || *(buffer + x) == 'q') { //ignore diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index a23ec60..8f712d8 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -54,7 +54,6 @@ #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" -#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1) #define BLD_INF_RULES_BASE "BLD_INF_RULES." #define BLD_INF_TAG_PLATFORMS "prj_platforms" @@ -232,7 +231,9 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) QString wrapperFileName("Makefile"); QString outputFileName = fileInfo(Option::output.fileName()).fileName(); if (outputFileName != BLD_INF_FILENAME) { - wrapperFileName.append(".").append((outputFileName.size() > BLD_INF_FILENAME_LEN && outputFileName.left(BLD_INF_FILENAME_LEN) == BLD_INF_FILENAME) ? outputFileName.mid(8) : outputFileName); + wrapperFileName.append(".").append(outputFileName.startsWith(BLD_INF_FILENAME) + ? outputFileName.mid(sizeof(BLD_INF_FILENAME)) + : outputFileName); isPrimaryMakefile = false; } @@ -266,7 +267,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) writeMmpFile(mmpFilename, symbianLangCodes); if (targetType == TypeExe) { - if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) { + if (!project->isActiveConfig("no_icon")) { writeRegRssFile(userRssRules); writeRssFile(numberOfIcons, iconFile); writeLocFile(symbianLangCodes); @@ -391,7 +392,7 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme .arg(exeFile) << endl; // deploy rsc & reg_rsc file - if (!project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) { + if (!project->isActiveConfig("no_icon")) { t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"") .arg(epocRoot()) .arg(fixedTarget + ".rsc") @@ -484,7 +485,7 @@ bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStri void SymbianMakefileGenerator::writeCustomDefFile() { - if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { + if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { // Create custom def file for plugin QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL)); @@ -549,9 +550,9 @@ void SymbianMakefileGenerator::init() targetType = TypeExe; else if ((project->values("TEMPLATE")).contains("lib")) { // Check CONFIG to see if we are to build staticlib or dll - if (project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static")) + if (project->isActiveConfig("staticlib") || project->isActiveConfig("static")) targetType = TypeLib; - else if (project->values("CONFIG").contains("plugin")) + else if (project->isActiveConfig("plugin")) targetType = TypePlugin; else targetType = TypeDll; @@ -561,7 +562,7 @@ void SymbianMakefileGenerator::init() if (0 != project->values("TARGET.UID2").size()) { uid2 = project->first("TARGET.UID2"); - } else if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { + } else if (project->isActiveConfig("stdbinary")) { uid2 = "0x20004C45"; } else { if (targetType == TypeExe) { @@ -828,7 +829,7 @@ void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb } t << endl; - if (!project->values("CONFIG").contains("static") && !project->values("CONFIG").contains("staticlib")) { + if (!project->isActiveConfig("static") && !project->isActiveConfig("staticlib")) { writeMmpFileLibraryPart(t); } @@ -881,7 +882,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) if (targetType == TypeExe) { t << MMP_TARGET "\t\t" << fixedTarget << ".exe" << endl; if (!skipTargetType) { - if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) + if (project->isActiveConfig("stdbinary")) t << MMP_TARGETTYPE "\t\tSTDEXE" << endl; else t << MMP_TARGETTYPE "\t\tEXE" << endl; @@ -889,7 +890,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) } else if (targetType == TypeDll || targetType == TypePlugin) { t << MMP_TARGET "\t\t" << fixedTarget << ".dll" << endl; if (!skipTargetType) { - if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) + if (project->isActiveConfig("stdbinary")) t << MMP_TARGETTYPE "\t\tSTDDLL" << endl; else t << MMP_TARGETTYPE "\t\tDLL" << endl; @@ -897,7 +898,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) } else if (targetType == TypeLib) { t << MMP_TARGET "\t\t" << fixedTarget << ".lib" << endl; if (!skipTargetType) { - if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) + if (project->isActiveConfig("stdbinary")) t << MMP_TARGETTYPE "\t\tSTDLIB" << endl; else t << MMP_TARGETTYPE "\t\tLIB" << endl; @@ -933,7 +934,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) if (0 != project->values("TARGET.EPOCALLOWDLLDATA").size()) t << MMP_EPOCALLOWDLLDATA << endl; - if (targetType == TypePlugin && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { + if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { // Use custom def file for Qt plugins t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl; } @@ -949,7 +950,7 @@ void SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) { if ((targetType == TypeExe) && - !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) { + !project->isActiveConfig("no_icon")) { QString locTarget = fixedTarget; locTarget.append(".rss"); @@ -1307,7 +1308,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy // Add project mmps and old style extension makefiles QString mmpTag; - if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive)) + if (project->isActiveConfig("symbian_test")) mmpTag = QLatin1String(BLD_INF_TAG_TESTMMPFILES); else mmpTag = QLatin1String(BLD_INF_TAG_MMPFILES); @@ -1554,7 +1555,7 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico if (!numberOfIcons.isEmpty()) { bool ok; numberOfIcons = numberOfIcons.simplified(); - int tmp = numberOfIcons.toInt(&ok); + numberOfIcons.toInt(&ok); if (!ok) { numberOfIcons.clear(); iconFile.clear(); diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index d1e63cb..033bcbe 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -172,7 +172,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool releasePlatforms.removeAll("winscw"); // No release for emulator QString testClause; - if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive)) + if (project->isActiveConfig("symbian_test")) testClause = QLatin1String(" test"); else testClause = QLatin1String(""); diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 5adf30d..e081b19 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -106,7 +106,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo releasePlatforms.removeAll("winscw"); // No release for emulator QString testClause; - if (project->values("CONFIG").contains("symbian_test", Qt::CaseInsensitive)) + if (project->isActiveConfig("symbian_test")) testClause = QLatin1String(".test"); else testClause = QLatin1String(""); diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index efdf8ac..9d3b4c6 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -467,11 +467,12 @@ void Win32MakefileGenerator::processRcFileVar() resFile.replace(".rc", Option::res_ext); project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); - if (!project->values("OBJECTS_DIR").isEmpty()) + if (!project->values("OBJECTS_DIR").isEmpty()) { if(project->isActiveConfig("staticlib")) project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep); else project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep); + } project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false); project->values("POST_TARGETDEPS") += project->values("RES_FILE"); project->values("CLEAN_FILES") += project->values("RES_FILE"); diff --git a/qmake/meta.cpp b/qmake/meta.cpp index 1c71d60..5b36682 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -119,10 +119,11 @@ QMakeMetaInfo::findLib(QString lib) } } } - if(ret.isNull()) + if(ret.isNull()) { debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData()); - else + } else { debug_msg(2, "QMakeMetaInfo: Found info file %s for %s", ret.toLatin1().constData(), lib.toLatin1().constData()); + } return ret; } diff --git a/qmake/option.cpp b/qmake/option.cpp index 9577a28..5522a80 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -630,8 +630,8 @@ Option::fixString(QString string, uchar flags) string = string.replace('/', Option::dir_sep).replace('\\', Option::dir_sep); } - if (string.startsWith("\"") && string.endsWith("\"") || - string.startsWith("\'") && string.endsWith("\'")) + if ((string.startsWith("\"") && string.endsWith("\"")) || + (string.startsWith("\'") && string.endsWith("\'"))) string = string.mid(1, string.length()-2); //cache |