GH-1227: World import using drag and drop - zip files and folders

This commit is contained in:
Petr Mrázek
2015-09-09 23:53:33 +02:00
parent 51070a13f7
commit a1fd50e920
15 changed files with 345 additions and 121 deletions

View File

@ -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);