diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-04-04 01:30:37 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-05-15 22:56:14 +0200 |
commit | 67b22c8105f872582279274593bed431b3dd6510 (patch) | |
tree | ab595e9f1c273c1c5e8026a3f1ebf2ffb62d571e /api/logic/minecraft/ModList.h | |
parent | 12413f722de65fc221d2938cb16173be5b7e95d7 (diff) | |
download | MultiMC-67b22c8105f872582279274593bed431b3dd6510.tar MultiMC-67b22c8105f872582279274593bed431b3dd6510.tar.gz MultiMC-67b22c8105f872582279274593bed431b3dd6510.tar.lz MultiMC-67b22c8105f872582279274593bed431b3dd6510.tar.xz MultiMC-67b22c8105f872582279274593bed431b3dd6510.zip |
GH-575 clean up ModList - remove all legacy and obsolete parts
Diffstat (limited to 'api/logic/minecraft/ModList.h')
-rw-r--r-- | api/logic/minecraft/ModList.h | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/api/logic/minecraft/ModList.h b/api/logic/minecraft/ModList.h index 05ada8ee..5e7740bd 100644 --- a/api/logic/minecraft/ModList.h +++ b/api/logic/minecraft/ModList.h @@ -42,13 +42,16 @@ public: NameColumn, VersionColumn }; - ModList(const QString &dir, const QString &list_file = QString()); + ModList(const QString &dir); 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 + /// flags, mostly to support drag&drop + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + + virtual int rowCount(const QModelIndex &) const { return size(); } @@ -77,7 +80,7 @@ public: /** * Adds the given mod to the list at the given index - if the list supports custom ordering */ - virtual bool installMod(const QString & filename, int index = 0); + bool installMod(const QString& filename); /// Deletes the mod at the given index. virtual bool deleteMod(int index); @@ -85,39 +88,6 @@ public: /// Deletes all the selected mods virtual bool deleteMods(int first, int last); - /** - * move the mod at index to the position N - * 0 is the beginning of the list, length() is the end of the list. - */ - virtual bool moveModTo(int from, int to); - - /** - * move the mod at index one position upwards - */ - virtual bool moveModUp(int from); - virtual bool moveModsUp(int first, int last); - - /** - * move the mod at index one position downwards - */ - virtual bool moveModDown(int from); - virtual bool moveModsDown(int first, int last); - - /// flags, mostly to support drag&drop - virtual Qt::ItemFlags flags(const QModelIndex &index) const; - /// get data for drag action - virtual QMimeData *mimeData(const QModelIndexList &indexes) const; - /// get the supported mime types - virtual QStringList mimeTypes() const; - /// process data from drop action - virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, - const QModelIndex &parent); - /// what drag actions do we support? - virtual Qt::DropActions supportedDragActions() const; - - /// what drop actions do we support? - virtual Qt::DropActions supportedDropActions() const; - void startWatching(); void stopWatching(); @@ -140,9 +110,6 @@ private: QString id; bool enabled = false; }; - typedef QList<OrderItem> OrderList; - OrderList readListFile(); - bool saveListFile(); private slots: void directoryChanged(QString path); @@ -154,7 +121,6 @@ protected: QFileSystemWatcher *m_watcher; bool is_watching; QDir m_dir; - QString m_list_file; QString m_list_id; QList<Mod> mods; }; |