From 4c762b2516bc664293c2aec072074f1e34dda8c3 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 18 Mar 2025 21:19:28 +0530 Subject: Remove all the ui bits because screw it, lets unix a bit more --- src/completion/CommandsModel.cpp | 43 ---------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/completion/CommandsModel.cpp (limited to 'src/completion/CommandsModel.cpp') diff --git a/src/completion/CommandsModel.cpp b/src/completion/CommandsModel.cpp deleted file mode 100644 index 670c0e8..0000000 --- a/src/completion/CommandsModel.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "completion/CommandsModel.hpp" - -CommandsModel::CommandsModel(QObject *parent) : QAbstractListModel(parent) { - items = commands; -} - -QVariant CommandsModel::data(const QModelIndex &index, int role) const { - if (!index.isValid() || index.row() >= items.size()) - return QVariant(); - - const Command &item = items.at(index.row()); - - if (role == Qt::DisplayRole) - return item.name; - else if (role == Qt::UserRole) - return item.description; - else if (role == Qt::AccessibleDescriptionRole) - return item.name + item.description; - - return QVariant(); -} - -QHash CommandsModel::roleNames() const { - QHash roles; - roles[Qt::DisplayRole] = "name"; - roles[Qt::UserRole] = "description"; - roles[Qt::AccessibleDescriptionRole] = "full"; - return roles; -} - -int CommandsModel::rowCount(const QModelIndex &parent) const { - Q_UNUSED(parent); - return items.size(); -} - -int CommandsModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent); - return 2; // name + description -} -- cgit v1.3.1