diff options
Diffstat (limited to 'src/libs/installer/component.h')
-rw-r--r-- | src/libs/installer/component.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/libs/installer/component.h b/src/libs/installer/component.h index d042bfe6a..8f17b2d98 100644 --- a/src/libs/installer/component.h +++ b/src/libs/installer/component.h @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 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. @@ -32,7 +32,6 @@ #include "constants.h" #include "component_p.h" #include "qinstallerglobal.h" -#include "packagemanagercore.h" #include <QtCore/QDir> #include <QtCore/QMetaType> @@ -44,6 +43,8 @@ QT_FORWARD_DECLARE_CLASS(QQmlV4Function) namespace QInstaller { +class PackageManagerCore; + class INSTALLER_EXPORT Component : public QObject, public ComponentModelHelper { Q_OBJECT @@ -72,7 +73,9 @@ public: DepencyToUnstable = 0, ShaMismatch, ScriptLoadingFailed, - MissingDependency + MissingDependency, + InvalidTreeName, + DescendantOfUnstable }; Q_ENUM(UnstableError) @@ -106,6 +109,7 @@ public: QHash<QString, QString> variables() const; Q_INVOKABLE void setValue(const QString &key, const QString &value); Q_INVOKABLE QString value(const QString &key, const QString &defaultValue = QString()) const; + int removeValue(const QString &key); QStringList archives() const; PackageManagerCore *packageManagerCore() const; @@ -115,10 +119,9 @@ public: void removeComponent(Component *component); QList<Component*> descendantComponents() const; - void loadComponentScript(); + void loadComponentScript(const bool postLoad = false); + void evaluateComponentScript(const QString &fileName, const bool postScriptContext = false); - //move this to private - void loadComponentScript(const QString &fileName); void loadTranslations(const QDir &directory, const QStringList &qms); void loadUserInterfaces(const QDir &directory, const QStringList &uis); void loadLicenses(const QString &directory, const QHash<QString, QVariant> &hash); @@ -137,7 +140,7 @@ public: QList<QPair<QString, bool> > pathsForUninstallation() const; Q_INVOKABLE void registerPathForUninstallation(const QString &path, bool wipe = false); - OperationList operations() const; + OperationList operations(const Operation::OperationGroups &mask = Operation::All) const; void addOperation(Operation *operation); Q_INVOKABLE bool addOperation(QQmlV4Function *args); @@ -147,9 +150,10 @@ public: Q_INVOKABLE bool addElevatedOperation(QQmlV4Function *args); bool addElevatedOperation(const QString &operation, const QStringList ¶meters); - QStringList downloadableArchives() const; + QStringList downloadableArchives(); Q_INVOKABLE void addDownloadableArchive(const QString &path); Q_INVOKABLE void removeDownloadableArchive(const QString &path); + void addDownloadableArchives(const QString& archives); QStringList stopProcessForUpdateRequests() const; Q_INVOKABLE void addStopProcessForUpdateRequest(const QString &process); @@ -159,6 +163,7 @@ public: QString name() const; QString displayName() const; QString treeName() const; + bool treeNameMoveChildren() const; quint64 updateUncompressedSize(); QUrl repositoryUrl() const; @@ -166,8 +171,10 @@ public: Q_INVOKABLE void addDependency(const QString &newDependency); QStringList dependencies() const; + QStringList localDependencies() const; Q_INVOKABLE void addAutoDependOn(const QString &newDependOn); QStringList autoDependencies() const; + QStringList currentDependencies() const; void languageChanged(); QString localTempPath() const; @@ -190,7 +197,8 @@ public: Q_INVOKABLE bool isFromOnlineRepository() const; Q_INVOKABLE void setUpdateAvailable(bool isUpdateAvailable); - Q_INVOKABLE bool updateRequested(); + Q_INVOKABLE bool isUpdateAvailable() const; + Q_INVOKABLE bool updateRequested() const; Q_INVOKABLE bool componentChangeRequested(); Q_INVOKABLE bool isForcedUpdate(); @@ -201,6 +209,7 @@ public: bool isVirtual() const; bool isSelected() const; bool forcedInstallation() const; + bool isEssential() const; void setValidatorCallbackName(const QString &name); @@ -227,7 +236,9 @@ private: const QString ¶meter8 = QString(), const QString ¶meter9 = QString(), const QString ¶meter10 = QString()); Operation *createOperation(const QString &operationName, const QStringList ¶meters); - void markComponentUnstable(); + void markComponentUnstable(const Component::UnstableError error, const QString &errorMessage); + + QJSValue callScriptMethod(const QString &methodName, const QJSValueList &arguments = QJSValueList()) const; private: QString validatorCallbackName; |