summaryrefslogtreecommitdiffstats
path: root/installerbuilder/libinstaller
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@nokia.com>2011-07-26 16:33:55 +0200
committerTim Jenssen <tim.jenssen@nokia.com>2011-07-27 14:25:58 +0200
commit02b859b819343cd0c5da300ea6ac3589d9316112 (patch)
tree2481d9fa5895b6353f51dc443a867be31a097bb9 /installerbuilder/libinstaller
parent31b7d64b278c81d720fc931a180ddd7281888a95 (diff)
added an updateIsAvailable flag to component class
Reviewed-By: Niels Weber
Diffstat (limited to 'installerbuilder/libinstaller')
-rw-r--r--installerbuilder/libinstaller/component.cpp18
-rw-r--r--installerbuilder/libinstaller/component.h4
-rw-r--r--installerbuilder/libinstaller/component_p.cpp3
-rw-r--r--installerbuilder/libinstaller/component_p.h1
4 files changed, 24 insertions, 2 deletions
diff --git a/installerbuilder/libinstaller/component.cpp b/installerbuilder/libinstaller/component.cpp
index ad5473ca0..533607357 100644
--- a/installerbuilder/libinstaller/component.cpp
+++ b/installerbuilder/libinstaller/component.cpp
@@ -987,7 +987,23 @@ bool Component::installationRequested() const
}
/*!
- Set's the components state to uninstalled.
+ Sets a flag that the core found an update
+*/
+void Component::setUpdateAvailable(bool isUpdateAvailable)
+{
+ d->m_updateIsAvailable = isUpdateAvailable;
+}
+
+/*!
+ Determines if the user wants to install the update for this component
+*/
+bool Component::updateRequested()
+{
+ return d->m_updateIsAvailable && isSelected();
+}
+
+/*!
+ Sets the component state to uninstalled.
*/
void Component::setUninstalled()
{
diff --git a/installerbuilder/libinstaller/component.h b/installerbuilder/libinstaller/component.h
index 9722d7c78..e4aab2357 100644
--- a/installerbuilder/libinstaller/component.h
+++ b/installerbuilder/libinstaller/component.h
@@ -186,6 +186,10 @@ public:
Q_INVOKABLE bool isFromOnlineRepository() const;
+ void setUpdateAvailable(bool isUpdateAvailable);
+ bool updateRequested();
+
+
bool isVirtual() const;
bool isSelected() const;
bool forcedInstallation() const;
diff --git a/installerbuilder/libinstaller/component_p.cpp b/installerbuilder/libinstaller/component_p.cpp
index 6402f7483..099420868 100644
--- a/installerbuilder/libinstaller/component_p.cpp
+++ b/installerbuilder/libinstaller/component_p.cpp
@@ -54,7 +54,8 @@ ComponentPrivate::ComponentPrivate(PackageManagerCore *core, Component *qq)
m_operationsCreated(false),
m_removeBeforeUpdate(true),
m_autoCreateOperations(true),
- m_operationsCreatedSuccessfully(true)
+ m_operationsCreatedSuccessfully(true),
+ m_updateIsAvailable(false)
{
}
diff --git a/installerbuilder/libinstaller/component_p.h b/installerbuilder/libinstaller/component_p.h
index 4ccc707c5..754ee9600 100644
--- a/installerbuilder/libinstaller/component_p.h
+++ b/installerbuilder/libinstaller/component_p.h
@@ -66,6 +66,7 @@ public:
bool m_removeBeforeUpdate;
bool m_autoCreateOperations;
bool m_operationsCreatedSuccessfully;
+ bool m_updateIsAvailable;
QString m_componentName;
QUrl m_repositoryUrl;