diff --git a/librarywidget.py b/librarywidget.py index 7fe902d5..598c8393 100644 --- a/librarywidget.py +++ b/librarywidget.py @@ -1486,13 +1486,14 @@ def showMoveItemsDialog(self, items, dst): self.moveItems(items, dst, copy=copy) - def moveItems(self, items, dst, copy=False): + def moveItems(self, items, dst, copy=False, force=False): """ Move the given items to the destination folder path. :type items: list[studiolibrary.LibraryItem] :type dst: str :type copy: bool + :type force: bool :rtype: None """ self.itemsWidget().clearSelection() @@ -1504,6 +1505,9 @@ def moveItems(self, items, dst, copy=False): path = dst + "/" + item.name() + if force: + path = studiolibrary.generateUniquePath(path) + if copy: item.copy(path) else: @@ -2355,7 +2359,7 @@ def moveItemsToTrash(self, items): :rtype: None """ self.createTrashFolder() - self.moveItems(items, dst=self.trashPath()) + self.moveItems(items, dst=self.trashPath(), force=True) def moveFolderToTrash(self, folder): """ @@ -2369,6 +2373,7 @@ def moveFolderToTrash(self, folder): src = folder.path() dst = os.path.join(self.trashPath(), os.path.basename(src)) + dst = studiolibrary.generateUniquePath(dst) self.renameFolder(src, dst=dst)