summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/uninstallercalculator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer/uninstallercalculator.h')
-rw-r--r--src/libs/installer/uninstallercalculator.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/libs/installer/uninstallercalculator.h b/src/libs/installer/uninstallercalculator.h
index a684c92cc..24979a9bb 100644
--- a/src/libs/installer/uninstallercalculator.h
+++ b/src/libs/installer/uninstallercalculator.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2023 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -29,6 +29,8 @@
#define UNINSTALLERCALCULATOR_H
#include "installer_global.h"
+#include "qinstallerglobal.h"
+#include "calculatorbase.h"
#include <QHash>
#include <QList>
@@ -38,26 +40,32 @@
namespace QInstaller {
class Component;
+class PackageManagerCore;
-class INSTALLER_EXPORT UninstallerCalculator
+class INSTALLER_EXPORT UninstallerCalculator : public CalculatorBase
{
public:
- UninstallerCalculator(const QList<Component *> &installedComponents);
+ UninstallerCalculator(PackageManagerCore *core,
+ const AutoDependencyHash &autoDependencyComponentHash,
+ const LocalDependencyHash &localDependencyComponentHash,
+ const QStringList &localVirtualComponents);
+ ~UninstallerCalculator();
- QSet<Component*> componentsToUninstall() const;
-
- void appendComponentsToUninstall(const QList<Component*> &components);
+ bool solve(const QList<Component*> &components) override;
+ QString resolutionText(Component *component) const override;
private:
+ bool solveComponent(Component *component, const QString &version = QString()) override;
- void appendComponentToUninstall(Component *component);
- void continueAppendComponentsToUninstall();
+ bool isRequiredVirtualPackage(Component *component);
+ void appendVirtualComponentsToUninstall();
- QList<Component *> m_installedComponents;
- QSet<Component *> m_componentsToUninstall;
+private:
+ AutoDependencyHash m_autoDependencyComponentHash;
+ LocalDependencyHash m_localDependencyComponentHash;
+ QStringList m_localVirtualComponents;
};
-}
-
+} // namespace QInstaller
#endif // UNINSTALLERCALCULATOR_H