From ba1209000a3175ce3b8f88829485c7c01efcc852 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Tue, 1 Dec 2015 10:50:22 +0200 Subject: 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 Reviewed-by: Iikka Eklund --- tools/common/repositorygen.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/common') 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: and " + "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")); -- cgit v1.2.3