summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/installercalculator.h
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2023-05-22 18:46:33 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2023-09-14 06:27:48 +0000
commit554aacf002690075872682b03e0bc836cf9cafe8 (patch)
tree5a2cc12d0c488068f3d5a6e2ec1a09a8701c8ffc /src/libs/installer/installercalculator.h
parent21e13337359d3d5fe63631127530c18a3191e83d (diff)
Add support for component aliases
Introduce concept of component aliases, which act as an alternative way for referring a set of related components. Component aliases are declared in an alias definition file, which is included to the created installer's binary layout as a resource. The file lists the available aliases, including metadata - such as name, version, and description - and the list of components and other aliases the alias requires. Aliases can be referred only from the CLI for the time being, with the supported commands 'install' and 'search'. Task-number: QTIFW-2978 Change-Id: I281f171cc7d932ce496051d7090ae169a4709eec Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/installercalculator.h')
-rw-r--r--src/libs/installer/installercalculator.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libs/installer/installercalculator.h b/src/libs/installer/installercalculator.h
index 339dbeffd..e542dc664 100644
--- a/src/libs/installer/installercalculator.h
+++ b/src/libs/installer/installercalculator.h
@@ -40,6 +40,7 @@
namespace QInstaller {
class Component;
+class ComponentAlias;
class PackageManagerCore;
class INSTALLER_EXPORT InstallerCalculator : public CalculatorBase
@@ -48,20 +49,28 @@ public:
InstallerCalculator(PackageManagerCore *core, const AutoDependencyHash &autoDependencyComponentHash);
~InstallerCalculator();
+ bool solve();
bool solve(const QList<Component *> &components) override;
+ bool solve(const QList<ComponentAlias *> &aliases);
+
QString resolutionText(Component *component) const override;
private:
bool solveComponent(Component *component, const QString &version = QString()) override;
+ bool solveAlias(ComponentAlias *alias);
void addComponentForInstall(Component *component, const QString &version = QString());
+ bool addComponentsFromAlias(ComponentAlias *alias);
QSet<Component *> autodependencyComponents();
QString recursionError(Component *component) const;
+ bool updateCheckState(Component *component, Qt::CheckState state);
+
private:
QHash<Component*, QSet<Component*> > m_visitedComponents;
QList<const Component*> m_componentsForAutodepencencyCheck;
QSet<QString> m_toInstallComponentIds; //for faster lookups
+ QSet<QString> m_toInstallComponentAliases;
//Helper hash for quicker search for autodependency components
AutoDependencyHash m_autoDependencyComponentHash;
};