2024-04-01 18:45:00 +07:00
|
|
|
#ifndef APPSPLITTUNNELINGMODEL_H
|
|
|
|
|
#define APPSPLITTUNNELINGMODEL_H
|
|
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
2026-04-30 14:53:03 +08:00
|
|
|
#include <QVector>
|
2024-04-01 18:45:00 +07:00
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
#include "core/utils/errorCodes.h"
|
|
|
|
|
#include "core/utils/routeModes.h"
|
|
|
|
|
#include "core/utils/commonStructs.h"
|
2024-04-01 18:45:00 +07:00
|
|
|
|
|
|
|
|
class AppSplitTunnelingModel: public QAbstractListModel
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum Roles {
|
|
|
|
|
AppPathRole = Qt::UserRole + 1,
|
|
|
|
|
PackageAppNameRole,
|
|
|
|
|
PackageAppIconRole
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-30 14:53:03 +08:00
|
|
|
explicit AppSplitTunnelingModel(QObject *parent = nullptr);
|
2024-04-01 18:45:00 +07:00
|
|
|
|
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
|
|
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
|
|
|
|
|
|
public slots:
|
2026-04-30 14:53:03 +08:00
|
|
|
void updateModel(const QVector<amnezia::InstalledAppInfo> &apps);
|
2024-04-01 18:45:00 +07:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
|
|
|
|
|
|
private:
|
2026-04-30 14:53:03 +08:00
|
|
|
QVector<amnezia::InstalledAppInfo> m_apps;
|
2024-04-01 18:45:00 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // APPSPLITTUNNELINGMODEL_H
|