Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Skip moving file to same directory

manongjohn1fa02efbd982
diff --git a/toonz/sources/toonz/dvdirtreeview.cpp b/toonz/sources/toonz/dvdirtreeview.cpp
index 8a002f5e4..6cf329961 100644
--- a/toonz/sources/toonz/dvdirtreeview.cpp
+++ b/toonz/sources/toonz/dvdirtreeview.cpp
@@ -431,6 +431,10 @@ void DvDirTreeView::dropEvent(QDropEvent *e) {
TFilePath srcFp(url.toLocalFile().toStdWString());
TFilePath dstFp = folderNode->getPath();
+ // Dropping file in the same directory that already exists should just be
+ // ignored
+ if (srcFp.getParentDir() == dstFp) continue;
+
TFilePath path = dstFp + TFilePath(srcFp.getLevelNameW());
NameBuilder *nameBuilder =
NameBuilder::getBuilder(::to_wstring(path.getName()));