summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/WorldList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-14 23:49:32 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-14 23:49:32 +0200
commit8d3f13c4478f7e99a32a0804d57ac2ece05d7e92 (patch)
tree2a18611e63cfbf501801563982562c136b0bca56 /logic/minecraft/WorldList.cpp
parentdd8eacee1b28ca40f8dc770587d111656d92d5fb (diff)
downloadMultiMC-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.tar
MultiMC-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.tar.gz
MultiMC-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.tar.lz
MultiMC-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.tar.xz
MultiMC-8d3f13c4478f7e99a32a0804d57ac2ece05d7e92.zip
GH-1227 add world copy and rename
Diffstat (limited to 'logic/minecraft/WorldList.cpp')
-rw-r--r--logic/minecraft/WorldList.cpp10
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();