GH-1227 add world copy and rename

This commit is contained in:
Petr Mrázek
2015-09-14 23:49:32 +02:00
parent dd8eacee1b
commit 8d3f13c447
7 changed files with 220 additions and 46 deletions

View File

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