aboutsummaryrefslogtreecommitdiff
path: root/src/completion/CommandsModel.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-03-18 21:19:28 +0530
committerAkshay Nair <phenax5@gmail.com>2025-03-18 21:19:47 +0530
commit4c762b2516bc664293c2aec072074f1e34dda8c3 (patch)
treeebe441f7af8c1f4c49f04630538312d55f18f63b /src/completion/CommandsModel.cpp
parent056b0b16947ac19a0c425aa9d2ff8f589378d3bc (diff)
downloadnull-browser-4c762b2516bc664293c2aec072074f1e34dda8c3.tar.gz
null-browser-4c762b2516bc664293c2aec072074f1e34dda8c3.zip
Remove all the ui bits because screw it, lets unix a bit more
Diffstat (limited to 'src/completion/CommandsModel.cpp')
-rw-r--r--src/completion/CommandsModel.cpp43
1 files changed, 0 insertions, 43 deletions
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 <QAbstractListModel>
-#include <QWidget>
-#include <QtCore>
-
-#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<int, QByteArray> CommandsModel::roleNames() const {
- QHash<int, QByteArray> 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
-}