summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/WorldList.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-09 23:53:33 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-09 23:53:33 +0200
commita1fd50e920eba0f198b898e5df4ff5f60424d355 (patch)
tree6b2a3e0ec704d5edfec221c84ca1571376df9c1e /logic/minecraft/WorldList.h
parent51070a13f711e53835f9aadc220c8177440590d9 (diff)
downloadMultiMC-a1fd50e920eba0f198b898e5df4ff5f60424d355.tar
MultiMC-a1fd50e920eba0f198b898e5df4ff5f60424d355.tar.gz
MultiMC-a1fd50e920eba0f198b898e5df4ff5f60424d355.tar.lz
MultiMC-a1fd50e920eba0f198b898e5df4ff5f60424d355.tar.xz
MultiMC-a1fd50e920eba0f198b898e5df4ff5f60424d355.zip
GH-1227: World import using drag and drop - zip files and folders
Diffstat (limited to 'logic/minecraft/WorldList.h')
-rw-r--r--logic/minecraft/WorldList.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/logic/minecraft/WorldList.h b/logic/minecraft/WorldList.h
index 7f119e81..90c7c6ed 100644
--- a/logic/minecraft/WorldList.h
+++ b/logic/minecraft/WorldList.h
@@ -19,6 +19,7 @@
#include <QString>
#include <QDir>
#include <QAbstractListModel>
+#include <QMimeData>
#include "minecraft/World.h"
#include "multimc_logic_export.h"
@@ -71,16 +72,28 @@ public:
/// Reloads the mod list and returns true if the list changed.
virtual bool update();
+ /// Install a world from location
+ void installWorld(QFileInfo filename);
+
/// Deletes the mod at the given index.
virtual bool deleteWorld(int index);
/// Deletes all the selected mods
virtual bool deleteWorlds(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();
@@ -97,8 +110,6 @@ public:
return worlds;
}
-private:
- void internalSort(QList<World> &what);
private slots:
void directoryChanged(QString path);