diff options
-rw-r--r-- | doc/qbs-online.qdocconf | 16 | ||||
-rw-r--r-- | doc/reference/jsextensions/jsextension-process.qdoc | 8 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/rulesapplicator.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/tools/fileinfo.cpp | 7 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/nested-properties/product.qbs | 1 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs | 20 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 18 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 1 |
8 files changed, 70 insertions, 3 deletions
diff --git a/doc/qbs-online.qdocconf b/doc/qbs-online.qdocconf new file mode 100644 index 000000000..4c21d1e8e --- /dev/null +++ b/doc/qbs-online.qdocconf @@ -0,0 +1,16 @@ +include(config/qbs-project.qdocconf) + +HTML.footer = \ + " </div>\n" \ + " <p class=\"copy-notice\">\n" \ + " <acronym title=\"Copyright\">©</acronym> 2015 The Qt Company Ltd.\n" \ + " Documentation contributions included herein are the copyrights of\n" \ + " their respective owners. " \ + " The documentation provided herein is licensed under the terms of the" \ + " <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU Free Documentation" \ + " License version 1.3</a> as published by the Free Software Foundation. " \ + " Qt and respective logos are trademarks of The Qt Company Ltd " \ + " in Finland and/or other countries worldwide. All other trademarks are property\n" \ + " of their respective owners. </p>\n" + +include($QT_INSTALL_DOCS/global/qt-html-templates-online.qdocconf) diff --git a/doc/reference/jsextensions/jsextension-process.qdoc b/doc/reference/jsextensions/jsextension-process.qdoc index dc700bd99..3df109333 100644 --- a/doc/reference/jsextensions/jsextension-process.qdoc +++ b/doc/reference/jsextensions/jsextension-process.qdoc @@ -102,6 +102,14 @@ \endcode Reads and returns all data from the process' standard output channel. + \section2 setCodec + \code + setCodec(codec) + \endcode + Sets the text codec to \c codec. The codec is used for reading and writing from and to + the process, respectively. The supported codecs are the same as for \c QTextCodec, for example: + "UTF-8", "UTF-16", and "ISO 8859-1". + \section2 setEnv \code setEnv(varName: string, varValue: string): string diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp index dbc2245a5..ed7bef9de 100644 --- a/src/lib/corelib/buildgraph/rulesapplicator.cpp +++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp @@ -445,7 +445,7 @@ public: { QStringList tmp = nameParts; const QString propertyName = tmp.takeLast(); - const QString moduleName = tmp.join(QLatin1Char('.')); + const QString moduleName = tmp.join(QLatin1String(".")); const QStringList modulePath = findModulePath(cfg, moduleName); if (modulePath.isEmpty()) return modulePath; diff --git a/src/lib/corelib/tools/fileinfo.cpp b/src/lib/corelib/tools/fileinfo.cpp index 284f5323e..11f6f0c29 100644 --- a/src/lib/corelib/tools/fileinfo.cpp +++ b/src/lib/corelib/tools/fileinfo.cpp @@ -323,9 +323,12 @@ bool removeFileRecursion(const QFileInfo &f, QString *errorMessage) { if (!FileInfo::fileExists(f)) return true; - if (f.isDir()) { + if (f.isDir() && !f.isSymLink()) { const QDir dir(f.absoluteFilePath()); - foreach(const QFileInfo &fi, dir.entryInfoList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden)) + + // QDir::System is needed for broken symlinks. + foreach (const QFileInfo &fi, dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot + | QDir::Hidden | QDir::System)) removeFileRecursion(fi, errorMessage); QDir parent = f.absoluteDir(); if (!parent.rmdir(f.fileName())) { diff --git a/tests/auto/blackbox/testdata/nested-properties/product.qbs b/tests/auto/blackbox/testdata/nested-properties/product.qbs index b2356599d..af747d405 100644 --- a/tests/auto/blackbox/testdata/nested-properties/product.qbs +++ b/tests/auto/blackbox/testdata/nested-properties/product.qbs @@ -3,6 +3,7 @@ import qbs Product { type: "mytype" Depends { name: "higherlevel" } + Depends { name: "lowerlevel" } Group { files: ["dummy.txt"] fileTags: ["dummy-input"] diff --git a/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs b/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs new file mode 100644 index 000000000..8e74149d1 --- /dev/null +++ b/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs @@ -0,0 +1,20 @@ +import qbs +import qbs.File + +Product { + type: "removal" + Transformer { + Artifact { + filePath: "dummy" + fileTags: product.type + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() { + File.remove(product.sourceDirectory + "/dir1"); + }; + return [cmd]; + } + } +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index dc69bd2de..121e0923f 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -433,6 +433,23 @@ void TestBlackbox::dependenciesProperty() QCOMPARE(product2_cpp.property("defines").toString(), QLatin1String("SMURF")); } +void TestBlackbox::symlinkRemoval() +{ + if (HostOsInfo::isWindowsHost()) + QSKIP("No symlink support on Windows."); + QDir::setCurrent(testDataDir + "/symlink-removal"); + QVERIFY(QDir::current().mkdir("dir1")); + QVERIFY(QDir::current().mkdir("dir2")); + QVERIFY(QFile::link("dir2", "dir1/broken-link")); + QVERIFY(QFile::link(QFileInfo("dir2").absoluteFilePath(), "dir1/valid-link-to-dir")); + QVERIFY(QFile::link(QFileInfo("symlink-removal.qbs").absoluteFilePath(), + "dir1/valid-link-to-file")); + QCOMPARE(runQbs(), 0); + QVERIFY(!QFile::exists("dir1")); + QVERIFY(QFile::exists("dir2")); + QVERIFY(QFile::exists("symlink-removal.qbs")); +} + void TestBlackbox::usingsAsSoleInputsNonMultiplexed() { QDir::setCurrent(testDataDir + QLatin1String("/usings-as-sole-inputs-non-multiplexed")); @@ -1635,6 +1652,7 @@ void TestBlackbox::nestedProperties() { QDir::setCurrent(testDataDir + "/nested-properties"); QCOMPARE(runQbs(), 0); + QEXPECT_FAIL(0, "QBS-736", Abort); QVERIFY2(m_qbsStdout.contains("value in higherlevel"), m_qbsStdout.constData()); } diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index e05f8a035..8cae64109 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -127,6 +127,7 @@ private slots: void radAfterIncompleteBuild_data(); void radAfterIncompleteBuild(); void subProfileChangeTracking(); + void symlinkRemoval(); void usingsAsSoleInputsNonMultiplexed(); void clean(); void renameDependency(); |