From 6126d5c033e669bd57fc26093eb9be368feb12e2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 17 May 2010 16:14:32 +0200 Subject: qmake: added possibility to specify the type of an install target Before this change: target.CONFIG+=no_check_exist implies the file is a file, no way to make an install rule for a non-existing directory. Now, its possible to specify the type: target.CONFIG+=no_check_exist directory will install a directory. target.CONFIG+=no_check_exist executable will install an executable. target.CONFIG+=no_check_exist data will install a normal file. The default case, if no type is given, like in CONFIG+=no_check_exist will call QFileInfo::isExecutable() to determine, if its a data file or executable. This is the old behaviour. Task-number: QTBUG-10624 Reviewed-by: ossi --- doc/doc.pri | 4 ++-- qmake/generators/makefile.cpp | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/doc/doc.pri b/doc/doc.pri index 463c447..c6073f0 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -45,11 +45,11 @@ docs.depends = adp_docs qch_docs # Install rules htmldocs.files = $$QT_BUILD_TREE/doc/html htmldocs.path = $$[QT_INSTALL_DOCS] -htmldocs.CONFIG += no_check_exist +htmldocs.CONFIG += no_check_exist directory qchdocs.files= $$QT_BUILD_TREE/doc/qch qchdocs.path = $$[QT_INSTALL_DOCS] -qchdocs.CONFIG += no_check_exist +qchdocs.CONFIG += no_check_exist directory docimages.files = $$QT_BUILD_TREE/doc/src/images docimages.path = $$[QT_INSTALL_DOCS]/src diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index db2737b..6b85561 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1277,13 +1277,26 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n } QString local_dirstr = Option::fixPathToLocalOS(dirstr, true); QStringList files = QDir(local_dirstr).entryList(QStringList(filestr)); - if(project->values((*it) + ".CONFIG").indexOf("no_check_exist") != -1 && files.isEmpty()) { + const QStringList &installConfigValues = project->values((*it) + ".CONFIG"); + if (installConfigValues.contains("no_check_exist") && files.isEmpty()) { if(!target.isEmpty()) target += "\t"; QString dst_file = filePrefixRoot(root, dst); QFileInfo fi(fileInfo(wild)); - QString cmd = QString(fi.isExecutable() ? "-$(INSTALL_PROGRAM)" : "-$(INSTALL_FILE)") + " " + - wild + " " + dst_file + "\n"; + QString cmd; + if (installConfigValues.contains("directory")) { + cmd = QLatin1String("-$(INSTALL_DIR)"); + if (!dst_file.endsWith(Option::dir_sep)) + dst_file += Option::dir_sep; + dst_file += fi.fileName(); + } else if (installConfigValues.contains("executable")) { + cmd = QLatin1String("-$(INSTALL_PROGRAM)"); + } else if (installConfigValues.contains("data")) { + cmd = QLatin1String("-$(INSTALL_FILE)"); + } else { + cmd = QString(fi.isExecutable() ? "-$(INSTALL_PROGRAM)" : "-$(INSTALL_FILE)"); + } + cmd += " " + wild + " " + dst_file + "\n"; target += cmd; if(!uninst.isEmpty()) uninst.append("\n\t"); -- cgit v0.12 From 01e7389086d4afde33c3e2b1ece9c6d906869e08 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 17 May 2010 17:43:16 +0200 Subject: QCompleter: fix misuse of QMap that can lead to crashes Patch providedin the task. Task-number: QTBUG-8407 --- src/gui/util/qcompleter.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index cefdb27..ce2eff5 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -527,17 +527,22 @@ void QCompletionEngine::saveInCache(QString part, const QModelIndex& parent, con QMatchData old = cache[parent].take(part); cost = cost + m.indices.cost() - old.indices.cost(); if (cost * sizeof(int) > 1024 * 1024) { - QMap::iterator it1 ; - for (it1 = cache.begin(); it1 != cache.end(); ++it1) { + QMap::iterator it1 = cache.begin(); + while (it1 != cache.end()) { CacheItem& ci = it1.value(); int sz = ci.count()/2; QMap::iterator it2 = ci.begin(); - for (int i = 0; it2 != ci.end() && i < sz; i++, ++it2) { + int i = 0; + while (it2 != ci.end() && i < sz) { cost -= it2.value().indices.cost(); - ci.erase(it2); + it2 = ci.erase(it2); + i++; + } + if (ci.count() == 0) { + it1 = cache.erase(it1); + } else { + ++it1; } - if (ci.count() == 0) - cache.erase(it1); } } -- cgit v0.12 From 8aff2b3e6f09b446f124b7023485e947ab1bf24b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 17 May 2010 17:47:00 +0200 Subject: Doc: fix typo --- src/gui/util/qcompleter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index ce2eff5..9a99abe 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -1753,7 +1753,7 @@ QStringList QCompleter::splitPath(const QString& path) const This signal is sent when an item in the popup() is highlighted by the user. It is also sent if complete() is called with the completionMode() - set to QCOmpleter::InlineCompletion. The item's \a text is given. + set to QCompleter::InlineCompletion. The item's \a text is given. */ QT_END_NAMESPACE -- cgit v0.12 From 7df8d538cdde7bf103950b2bdcb20781c0f07e69 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 18 May 2010 10:56:29 +0200 Subject: QNAM HTTP: Remove dead code --- src/network/access/qnetworkaccesshttpbackend_p.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h index 0eaf003..b0f0ed0 100644 --- a/src/network/access/qnetworkaccesshttpbackend_p.h +++ b/src/network/access/qnetworkaccesshttpbackend_p.h @@ -94,8 +94,6 @@ public: #endif QNetworkCacheMetaData fetchCacheMetaData(const QNetworkCacheMetaData &metaData) const; - qint64 deviceReadData(char *buffer, qint64 maxlen); - // we return true since HTTP needs to send PUT/POST data again after having authenticated bool needsResetableUploadData() { return true; } -- cgit v0.12 From f29f46107204ea542ec899915508a69f520f6159 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 19 May 2010 11:35:48 +1000 Subject: Fixed tst_compilerwarnings test failure due to icecc node failures. When an icecc node has some system error, icecc on the client side outputs a warning. Since it's able to recover and the warning has nothing to do with the code, we should ignore it. Other distributed compile tools will have similar issues, but no attempt has been made to cover them. --- .../auto/compilerwarnings/tst_compilerwarnings.cpp | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index f910a18..82c327a 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -62,6 +62,9 @@ class tst_CompilerWarnings: public QObject private slots: void warnings_data(); void warnings(); + +private: + bool shouldIgnoreWarning(QString const&); }; #if 0 @@ -242,16 +245,37 @@ void tst_CompilerWarnings::warnings() if (!errs.isEmpty()) { errList = errs.split("\n"); qDebug() << "Arguments:" << args; - foreach (QString err, errList) { - qDebug() << err; + QStringList validErrors; + foreach (QString const& err, errList) { + bool ignore = shouldIgnoreWarning(err); + qDebug() << err << (ignore ? " [ignored]" : ""); + if (!ignore) { + validErrors << err; + } } + errList = validErrors; } QCOMPARE(errList.count(), 0); // verbose info how many lines of errors in output - QVERIFY(errs.isEmpty()); tmpQSourceFile.remove(); } +bool tst_CompilerWarnings::shouldIgnoreWarning(QString const& warning) +{ + if (warning.isEmpty()) { + return true; + } + + // icecc outputs warnings if some icecc node breaks + if (warning.startsWith("ICECC[")) { + return true; + } + + // Add more bogus warnings here + + return false; +} + QTEST_APPLESS_MAIN(tst_CompilerWarnings) #include "tst_compilerwarnings.moc" -- cgit v0.12