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>
This commit is contained in:
BlackAngelTV committed 2026-08-27 19:29:24 +02:00
1 parent 4a773c63ce
commit 5054f04c54
23 files changed
+276 -1735

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
#include "package-model.h"
PackageModel::PackageModel(QObject* parent) : QAbstractListModel(parent) {}
int PackageModel::rowCount(const QModelIndex& parent) const {
Q_UNUSED(parent);
return static_cast<int>(m_packages.size());
}
QVariant PackageModel::data(const QModelIndex& index, int role) const {
if (!index.isValid() || index.row() >= static_cast<int>(m_packages.size())) {
return QVariant();
}
const PackageInfo& pkg = m_packages[index.row()];
switch (role) {
case NameRole: return QString::fromStdString(pkg.name);
case VersionRole: return QString::fromStdString(pkg.version);
case DescriptionRole: return QString::fromStdString(pkg.description);
case RepositoryRole: return QString::fromStdString(pkg.repository);
case InstalledRole: return pkg.installed;
case SizeRole: return QString::fromStdString(pkg.size);
case UpdateAvailableRole: return pkg.updateAvailable;
default: return QVariant();
}
}
QHash<int, QByteArray> PackageModel::roleNames() const {
return {
{NameRole, "name"},
{VersionRole, "version"},
{DescriptionRole, "description"},
{RepositoryRole, "repository"},
{InstalledRole, "installed"},
{SizeRole, "size"},
{UpdateAvailableRole, "updateAvailable"}
};
}
void PackageModel::setPackages(const std::vector<PackageInfo>& packages) {
beginResetModel();
m_packages = packages;
endResetModel();
}
void PackageModel::clear() {
beginResetModel();
m_packages.clear();
endResetModel();
}
PackageInfo PackageModel::getPackage(int row) const {
if (row >= 0 && row < static_cast<int>(m_packages.size())) {
return m_packages[row];
}
return PackageInfo{};
}