diff options
author | Katja Marttila <katja.marttila@theqtcompany.com> | 2015-12-01 10:50:22 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-01-18 12:01:50 +0000 |
commit | ba1209000a3175ce3b8f88829485c7c01efcc852 (patch) | |
tree | a9c943c38ad1fe3fe632cdaaac00a9586e147f8f /tools | |
parent | 8b344748b7059ade811c7b0f28c4458b0d01eb4d (diff) |
Allow defining non-checkable items
This change will introduce new element 'Checkable' for package.
Setting checkable to false will hide checkbox. Useful if use case
is to install one sub item instead of all sub items.
Change-Id: I8c731e77353b6da539dddcecdc8495b28ef5f7ea
Task-number: QTIFW-773
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/common/repositorygen.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/common/repositorygen.cpp b/tools/common/repositorygen.cpp index 40caf388b..316f26022 100644 --- a/tools/common/repositorygen.cpp +++ b/tools/common/repositorygen.cpp @@ -190,6 +190,7 @@ void QInstallerTools::copyMetaData(const QString &_targetDir, const QString &met bool foundVirtual = false; bool foundDisplayName = false; bool foundDownloadableArchives = false; + bool foundCheckable = false; const QDomNode package = packageXml.firstChildElement(QLatin1String("Package")); const QDomNodeList childNodes = package.childNodes(); for (int i = 0; i < childNodes.count(); ++i) { @@ -204,6 +205,8 @@ void QInstallerTools::copyMetaData(const QString &_targetDir, const QString &met foundDisplayName = true; if (key == QLatin1String("DownloadableArchives")) foundDownloadableArchives = true; + if (key == QLatin1String("Checkable")) + foundCheckable = true; if (node.isComment() || blackList.contains(key)) continue; // just skip comments and some tags... @@ -220,6 +223,12 @@ void QInstallerTools::copyMetaData(const QString &_targetDir, const QString &met "mutually exclusive in file \"%1\".").arg(QDir::toNativeSeparators(packageXmlPath))); } + if (foundDefault && foundCheckable) { + throw QInstaller::Error(QString::fromLatin1("Error: <Default> and <Checkable>" + "elements are mutually exclusive in file \"%1\".") + .arg(QDir::toNativeSeparators(packageXmlPath))); + } + if (!foundDisplayName) { qWarning() << "No DisplayName tag found at" << info.name << ", using component Name instead."; QDomElement displayNameElement = doc.createElement(QLatin1String("DisplayName")); |