diff --git a/views_handler.cpp b/views_handler.cpp index da660e4..75fc84c 100644 --- a/views_handler.cpp +++ b/views_handler.cpp @@ -95,6 +95,9 @@ void ViewsHandler::initConnection() QObject::connect(this, &ViewsHandler::fileDelete, &proxyModel, &NavigationProxyModel::deleteFileFolderHandler); + QObject::connect(this, &ViewsHandler::fileDeletePath, + recentFilesView, &RecentFilesDialog::removeRecentDeletedFileHandle); + QObject::connect(viewTree,&NavigationView::deleteFileFolder, this, &ViewsHandler::fileDeleteDialogue); @@ -378,6 +381,12 @@ void ViewsHandler::fileDeleteDialogue(QModelIndex &index) confirmBox->setDefaultButton(QMessageBox::No); if(QMessageBox::Yes == confirmBox->exec()){ emit fileDelete(index); + + QString currentFilePath = info.absoluteFilePath(); + if (currentFilePath.startsWith(vaultPath)) { + currentFilePath.replace(vaultPath, ""); + } + emit fileDeletePath(currentFilePath); } } diff --git a/views_handler.h b/views_handler.h index 11d5263..728b7ec 100644 --- a/views_handler.h +++ b/views_handler.h @@ -100,6 +100,7 @@ public slots: void load_text(QString text); void clear_text(); void fileDelete(QModelIndex& index); + void fileDeletePath(const QString& path); void updateRecentFile(const QString &relativePath); private slots: