diff options
-rw-r--r-- | doc/reference/modules/qt-modules.qdoc | 7 | ||||
-rw-r--r-- | share/qbs/imports/qbs/ModUtils/utils.js | 7 | ||||
-rw-r--r-- | src/lib/qtprofilesetup/templates/core.qbs | 5 |
3 files changed, 18 insertions, 1 deletions
diff --git a/doc/reference/modules/qt-modules.qdoc b/doc/reference/modules/qt-modules.qdoc index 5e40e7107..8effee5b6 100644 --- a/doc/reference/modules/qt-modules.qdoc +++ b/doc/reference/modules/qt-modules.qdoc @@ -347,6 +347,13 @@ \li For files tagged as \c{qt.core.resource_data}, this property determines the prefix under which they will be available in the generated \c qrc file. \row + \li resourceFileBaseName + \li \c{string} + \li \c{product.targetName} + \li For files tagged as \c{qt.core.resource_data}, this property determines the base name + of the generated \c qrc file. If this property needs to be changed, it must be set + in the corresponding product rather than in a Group. + \row \li staticBuild \li \c{bool} \li \c{undefined} diff --git a/share/qbs/imports/qbs/ModUtils/utils.js b/share/qbs/imports/qbs/ModUtils/utils.js index 30302e111..800a58bc0 100644 --- a/share/qbs/imports/qbs/ModUtils/utils.js +++ b/share/qbs/imports/qbs/ModUtils/utils.js @@ -355,6 +355,13 @@ var PropertyValidator = (function () { ? " component" : " components")); }; + PropertyValidator.prototype.addFileNameValidator = function (propertyName, propertyValue) { + this.addCustomValidator(propertyName, propertyValue, function (value) { + return !/[/?<>\\:*|"\u0000-\u001f\u0080-\u009f]/.test(propertyValue) + && propertyValue !== "." && propertyValue !== ".."; + }, "cannot contain reserved or control characters and cannot be \".\" or \"..\""); + }; + PropertyValidator.prototype.addCustomValidator = function (propertyName, propertyValue, validator, message) { this.propertyValidators.push({ propertyName: propertyName, diff --git a/src/lib/qtprofilesetup/templates/core.qbs b/src/lib/qtprofilesetup/templates/core.qbs index 98b3d3b3a..cd17e0eed 100644 --- a/src/lib/qtprofilesetup/templates/core.qbs +++ b/src/lib/qtprofilesetup/templates/core.qbs @@ -199,6 +199,8 @@ Module { }, " is '" + qtBuildVariant + "', but qbs.buildVariant is '" + qbs.buildVariant + "', which is not allowed when using MSVC"); + validator.addFileNameValidator("resourceFileBaseName", resourceFileBaseName); + validator.validate(); } @@ -278,11 +280,12 @@ Module { property path resourceSourceBase: product.sourceDirectory property string resourcePrefix: "/" + property string resourceFileBaseName: product.targetName Rule { multiplex: true inputs: ["qt.core.resource_data"] Artifact { - filePath: "__qbs_auto_" + product.name + ".qrc" + filePath: product.moduleProperty("Qt.core", "resourceFileBaseName") + ".qrc" fileTags: ["qrc"] } prepare: { |