summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/component.cpp5
-rw-r--r--src/libs/installer/constants.h1
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp3
-rw-r--r--src/libs/kdtools/localpackagehub.cpp12
-rw-r--r--src/libs/kdtools/localpackagehub.h4
5 files changed, 21 insertions, 4 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 688a5b928..4ffefe384 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -66,6 +66,7 @@ static const QLatin1String scUpdateText("UpdateText");
static const QLatin1String scUninstalled("Uninstalled");
static const QLatin1String scCurrentState("CurrentState");
static const QLatin1String scForcedInstallation("ForcedInstallation");
+static const QLatin1String scCheckable("Checkable");
/*!
\inmodule QtInstallerFramework
@@ -261,6 +262,7 @@ void Component::loadDataFromPackage(const KDUpdater::LocalPackage &package)
}
setValue(scVirtual, package.virtualComp ? scTrue : scFalse);
setValue(scCurrentState, scInstalled);
+ setValue(scCheckable, package.checkable ? scTrue : scFalse);
}
/*!
@@ -293,6 +295,7 @@ void Component::loadDataFromPackage(const Package &package)
setValue(scScriptTag, package.data(scScriptTag).toString());
setValue(scReplaces, package.data(scReplaces).toString());
setValue(scReleaseDate, package.data(scReleaseDate).toString());
+ setValue(scCheckable, package.data(scCheckable).toString());
QString forced = package.data(scForcedInstallation, scFalse).toString().toLower();
if (PackageManagerCore::noForceInstallation())
@@ -384,6 +387,8 @@ void Component::setValue(const QString &key, const QString &value)
if (key == scName)
d->m_componentName = normalizedValue;
+ if (key == scCheckable)
+ this->setCheckable(normalizedValue.toLower() == scTrue);
d->m_vars[key] = normalizedValue;
emit valueChanged(key, normalizedValue);
diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h
index 0550b94f8..ecb998361 100644
--- a/src/libs/installer/constants.h
+++ b/src/libs/installer/constants.h
@@ -70,6 +70,7 @@ static const QLatin1String scRequiresAdminRights("RequiresAdminRights");
// constants used throughout the components class
static const QLatin1String scVirtual("Virtual");
static const QLatin1String scSortingPriority("SortingPriority");
+static const QLatin1String scCheckable("Checkable");
// constants used throughout the settings and package manager core class
static const QLatin1String scTitle("Title");
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 51ea4df38..ce6bc8cd4 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -1924,7 +1924,8 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr
component->forcedInstallation(),
component->isVirtual(),
component->value(scUncompressedSize).toULongLong(),
- component->value(scInheritVersion));
+ component->value(scInheritVersion),
+ component->isCheckable());
m_localPackageHub->writeToDisk();
component->setInstalled();
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);
}
diff --git a/src/libs/kdtools/localpackagehub.h b/src/libs/kdtools/localpackagehub.h
index 0a7b8513c..0ea3a95c0 100644
--- a/src/libs/kdtools/localpackagehub.h
+++ b/src/libs/kdtools/localpackagehub.h
@@ -58,6 +58,7 @@ struct KDTOOLS_EXPORT LocalPackage
bool forcedInstallation;
bool virtualComp;
quint64 uncompressedSize;
+ bool checkable;
};
class KDTOOLS_EXPORT LocalPackageHub
@@ -108,7 +109,8 @@ public:
bool forcedInstallation,
bool virtualComp,
quint64 uncompressedSize,
- const QString &inheritVersionFrom);
+ const QString &inheritVersionFrom,
+ bool checkable);
bool removePackage(const QString &pkgName);
void refresh();