From 67b22c8105f872582279274593bed431b3dd6510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 4 Apr 2016 01:30:37 +0200 Subject: GH-575 clean up ModList - remove all legacy and obsolete parts --- api/logic/minecraft/ModList.h | 46 ++++++------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) (limited to 'api/logic/minecraft/ModList.h') 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 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 mods; }; -- cgit v1.2.3