Files
FWS-PacManage/include/package-model.h
BlackAngelTV 5054f04c54 refactor: replace plugin system with native pacman manager
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>
2026-08-27 19:29:24 +02:00

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;
};