summaryrefslogtreecommitdiffstats
path: root/src/manager-lib/packagemanager_p.h
blob: 8ff4c404e5383b0fe034968d9ed9c141887cb63c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2019 Luxoft Sweden AB
// Copyright (C) 2018 Pelagicore AG
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef PACKAGEMANAGER_P_H
#define PACKAGEMANAGER_P_H

#include <QMutex>
#include <QList>
#include <QSet>
#include <QThread>

#include <QtAppManManager/packagemanager.h>
#include <QtAppManApplication/packagedatabase.h>
#include <QtAppManManager/asynchronoustask.h>
#include <QtAppManCommon/global.h>
#include <QtAppManCommon/private/qtappman_common-config_p.h>

QT_BEGIN_NAMESPACE_AM

bool removeRecursiveHelper(const QString &path);

class PackageManagerPrivate
{
public:
    PackageDatabase *database = nullptr;
    QVector<Package *> packages;
    bool aboutToBeRemoved = false;

    QMap<Package *, PackageInfo *> pendingPackageInfoUpdates;  // AXIVION Line Qt-QMapWithPointerKey: package is locked

    bool enableInstaller = false;
    bool developmentMode = false;
    bool allowInstallationOfUnsignedPackages = false;

    QString installationPath;
    QString documentPath;

    QString error;

    QString hardwareId;
    QByteArrayList chainOfTrust;
    bool cleanupBrokenInstallationsDone = false;

#if QT_CONFIG(am_installer)
    QList<AsynchronousTask *> incomingTaskList;     // incoming queue
    QList<AsynchronousTask *> installationTaskList; // installation jobs in state >= AwaitingAcknowledge
    AsynchronousTask *activeTask = nullptr;         // currently active

    QList<AsynchronousTask *> allTasks() const
    {
        QList<AsynchronousTask *> all = incomingTaskList;
        if (!installationTaskList.isEmpty())
            all += installationTaskList;
        if (activeTask)
            all += activeTask;
        return all;
    }
#endif
};

QT_END_NAMESPACE_AM
// We mean it. Dummy comment since syncqt needs this also for completely private Qt modules.

#endif // PACKAGEMANAGER_P_H