From bd3d8e951b4fe1adb70c00cf724076d77113f0b9 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 26 Nov 2016 18:13:07 -0500 Subject: [PATCH] Document screen: when trashing the current document by drag-n-drop, select a new one --- src/document/UBDocumentController.h | 3 ++- src/gui/UBDocumentTreeWidget.cpp | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index f4614174..39e5f635 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -55,6 +55,8 @@ class UBDocumentController : public UBDocumentContainer { Q_OBJECT + friend class UBDocumentTreeWidget; + public: UBDocumentController(UBMainWindow* mainWindow); virtual ~UBDocumentController(); @@ -163,5 +165,4 @@ class UBDocumentController : public UBDocumentContainer }; - #endif /* UBDOCUMENTCONTROLLER_H_ */ diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index cd6ba2f6..37a93ecf 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -375,10 +375,8 @@ bool UBDocumentTreeWidget::moveDocument(UBDocumentProxyTreeItem* document, UBDoc QString destinationFolderName; - if (destinationFolder->isTrashFolder()) { - QString sourceFolderName = document->proxy()->metaData(UBSettings::documentGroupName).toString(); - destinationFolderName = UBSettings::trashedDocumentGroupNamePrefix + sourceFolderName; - } + if (destinationFolder->isTrashFolder()) + UBApplication::app()->documentController->moveDocumentToTrash(sourceFolder, document, true); else { if (destinationFolder->groupName() == UBApplication::app()->documentController->defaultDocumentGroupName())