Remove the dynamic plugin loader (pacman/apt/pkg/universal) and drive the UI directly through PacmanManager. Rename sources and headers to kebab-case to match the project's file naming convention. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
35 lines
856 B
C++
35 lines
856 B
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QAbstractListModel>
|
|
#include <QVariant>
|
|
#include <vector>
|
|
#include "package-manager.h"
|
|
|
|
class PackageModel : public QAbstractListModel {
|
|
Q_OBJECT
|
|
public:
|
|
enum Roles {
|
|
NameRole = Qt::UserRole + 1,
|
|
VersionRole,
|
|
DescriptionRole,
|
|
RepositoryRole,
|
|
InstalledRole,
|
|
SizeRole,
|
|
UpdateAvailableRole
|
|
};
|
|
|
|
explicit PackageModel(QObject* parent = nullptr);
|
|
|
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
void setPackages(const std::vector<PackageInfo>& packages);
|
|
void clear();
|
|
PackageInfo getPackage(int row) const;
|
|
|
|
private:
|
|
std::vector<PackageInfo> m_packages;
|
|
};
|