diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-10-06 15:58:43 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-10-06 16:05:51 +0200 |
commit | 62cf969c09ef821a0f8153e2fd9538c6664e8bef (patch) | |
tree | 6f07ab78f708e230b80b8f0393817a8702c5216b /src/libs/installer/packagemanagercore.h | |
parent | 0d529d9a8920ba308897c2ca3c69ac98109b0340 (diff) |
Rewrite the component getter mess, remove superfluous methods.
Now we can combine some enum values to achieve the same as before
with the several getter functions, removes the clutter from the API.
Change-Id: I6368b0ff77821ac95d1defaec4af27dd7d383396
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/libs/installer/packagemanagercore.h')
-rw-r--r-- | src/libs/installer/packagemanagercore.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h index 5e372d53e..c85c42d8e 100644 --- a/src/libs/installer/packagemanagercore.h +++ b/src/libs/installer/packagemanagercore.h @@ -101,6 +101,16 @@ public: End = 0xffff }; + enum struct ComponentType { + Root = 0x1, + Descendants = 0x2, + Dependencies = 0x4, + Replacements = 0x8, + AllNoReplacements = (Root | Descendants | Dependencies), + All = (Root | Descendants | Dependencies | Replacements) + }; + Q_DECLARE_FLAGS(ComponentTypes, ComponentType) + static QFont virtualComponentsFont(); static void setVirtualComponentsFont(const QFont &font); @@ -187,19 +197,10 @@ public: // component handling - int rootComponentCount() const; - Component *rootComponent(int i) const; - QList<Component*> rootComponents() const; void appendRootComponent(Component *components); - - QList<Component*> rootAndChildComponents() const; - - Q_INVOKABLE int updaterComponentCount() const; - Component *updaterComponent(int i) const; - QList<Component*> updaterComponents() const; void appendUpdaterComponent(Component *components); - QList<Component*> availableComponents() const; + QList<Component *> components(ComponentTypes mask) const; Component *componentByName(const QString &identifier) const; Q_INVOKABLE bool calculateComponentsToInstall() const; @@ -341,6 +342,7 @@ private: friend class ComponentSelectionPage; void resetComponentsToUserCheckedState(); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(PackageManagerCore::ComponentTypes) } |