Skip to content

Commit

Permalink
Github Issue #106: Connecting recently deleted file path to recently …
Browse files Browse the repository at this point in the history
…opened file dialog to be removed from the list
  • Loading branch information
AngryFender committed Oct 20, 2023
1 parent 5dfd8f3 commit ba3e990
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions views_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions views_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ba3e990

Please sign in to comment.