From acf25d8a33ef67b79d8e8a8859f5559e011373a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 26 Dec 2013 05:14:32 +0100 Subject: Disable/enable mods with checkboxes. Needs testing. A lot of testing! --- logic/ModList.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'logic/ModList.h') diff --git a/logic/ModList.h b/logic/ModList.h index 803a5429..0d6507fb 100644 --- a/logic/ModList.h +++ b/logic/ModList.h @@ -34,9 +34,18 @@ class ModList : public QAbstractListModel { Q_OBJECT public: + enum Columns + { + ActiveColumn = 0, + NameColumn, + VersionColumn + }; ModList(const QString &dir, const QString &list_file = QString()); virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex &index, const QVariant &value, + int role = Qt::EditRole); + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const { return size(); @@ -59,7 +68,6 @@ public: { return mods[index]; } - ; /// Reloads the mod list and returns true if the list changed. virtual bool update(); @@ -119,7 +127,13 @@ public: } private: - QStringList readListFile(); + struct OrderItem + { + QString id; + bool enabled = false; + }; + typedef QList OrderList; + OrderList readListFile(); bool saveListFile(); private slots: -- cgit v1.2.3