diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-09-14 23:49:32 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-09-14 23:49:32 +0200 |
commit | 8d3f13c4478f7e99a32a0804d57ac2ece05d7e92 (patch) | |
tree | 2a18611e63cfbf501801563982562c136b0bca56 /logic/minecraft/WorldList.cpp | |
parent | dd8eacee1b28ca40f8dc770587d111656d92d5fb (diff) | |
download | PrismLauncher-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.tar.gz PrismLauncher-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.tar.bz2 PrismLauncher-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.zip |
GH-1227 add world copy and rename
Diffstat (limited to 'logic/minecraft/WorldList.cpp')
-rw-r--r-- | logic/minecraft/WorldList.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/logic/minecraft/WorldList.cpp b/logic/minecraft/WorldList.cpp index e58ca064..fff4f74a 100644 --- a/logic/minecraft/WorldList.cpp +++ b/logic/minecraft/WorldList.cpp @@ -164,6 +164,10 @@ QVariant WorldList::data(const QModelIndex &index, int role) const { return world.folderName(); } + case ObjectRole: + { + return QVariant::fromValue<void *>((void *)&world); + } case FolderRole: { return QDir::toNativeSeparators(dir().absoluteFilePath(world.folderName())); @@ -335,7 +339,11 @@ bool WorldList::dropMimeData(const QMimeData *data, Qt::DropAction action, int r QString filename = url.toLocalFile(); QFileInfo worldInfo(filename); - installWorld(worldInfo); + + if(!m_dir.entryInfoList().contains(worldInfo)) + { + installWorld(worldInfo); + } } if (was_watching) startWatching(); |