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 /src/libs/kdtools/localpackagehub.cpp | |
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 'src/libs/kdtools/localpackagehub.cpp')
-rw-r--r-- | src/libs/kdtools/localpackagehub.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libs/kdtools/localpackagehub.cpp b/src/libs/kdtools/localpackagehub.cpp index 6172de853..0510d8a38 100644 --- a/src/libs/kdtools/localpackagehub.cpp +++ b/src/libs/kdtools/localpackagehub.cpp @@ -315,7 +315,8 @@ void LocalPackageHub::refresh() \a forcedInstallation, \a virtualComp, \a uncompressedSize, - and \a inheritVersionFrom for the package. + \a inheritVersionFrom, + and \a checkable for the package. */ void LocalPackageHub::addPackage(const QString &name, const QString &version, @@ -326,7 +327,8 @@ void LocalPackageHub::addPackage(const QString &name, bool forcedInstallation, bool virtualComp, quint64 uncompressedSize, - const QString &inheritVersionFrom) + const QString &inheritVersionFrom, + bool checkable) { // TODO: This somewhat unexpected, remove? if (d->m_packageInfoMap.contains(name)) { @@ -346,6 +348,7 @@ void LocalPackageHub::addPackage(const QString &name, info.forcedInstallation = forcedInstallation; info.virtualComp = virtualComp; info.uncompressedSize = uncompressedSize; + info.checkable = checkable; d->m_packageInfoMap.insert(name, info); } d->modified = true; @@ -417,6 +420,8 @@ void LocalPackageHub::writeToDisk() addTextChildHelper(&package, QLatin1String("ForcedInstallation"), QLatin1String("true")); if (info.virtualComp) addTextChildHelper(&package, QLatin1String("Virtual"), QLatin1String("true")); + if (info.checkable) + addTextChildHelper(&package, QLatin1String("Checkable"), QLatin1String("true")); root.appendChild(package); } @@ -444,6 +449,7 @@ void LocalPackageHub::PackagesInfoData::addPackageFrom(const QDomElement &packag LocalPackage info; info.forcedInstallation = false; info.virtualComp = false; + info.checkable = false; for (int i = 0; i < childNodes.count(); i++) { QDomNode childNode = childNodes.item(i); QDomElement childNodeE = childNode.toElement(); @@ -476,6 +482,8 @@ void LocalPackageHub::PackagesInfoData::addPackageFrom(const QDomElement &packag info.lastUpdateDate = QDate::fromString(childNodeE.text(), Qt::ISODate); else if (childNodeE.tagName() == QLatin1String("InstallDate")) info.installDate = QDate::fromString(childNodeE.text(), Qt::ISODate); + else if (childNodeE.tagName() == QLatin1String("Checkable")) + info.checkable = childNodeE.text().toLower() == QLatin1String("true") ? true : false; } m_packageInfoMap.insert(info.name, info); } |