From 3fcf31d9365eb0179f07b0d13b1a162034ba6b05 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Wed, 24 Feb 2021 16:34:15 +0200 Subject: [PATCH] Enable/disable comics actions after updating search results Before this commit starting a search when an empty folder or an empty reading list was selected left all comics actions disabled. Fixes #213. When search mode is exited, we always call either YACReaderNavigationController::loadFolderInfo() or YACReaderNavigationController::loadListInfo(). Both of them call LibraryWindow::disableComicsActions(), so the enabled/disabled state of the comics actions stays up-to-date at all times. --- YACReaderLibrary/library_window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 5367ca33..a605bc5b 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -2165,10 +2165,13 @@ void LibraryWindow::setComicSearchFilterData(QList *data, const QSt comicsViewsManager->comicsView->enableFilterMode(true); comicsViewsManager->comicsView->setModel(comicsModel); //TODO, columns are messed up after ResetModel some times, this shouldn't be necesary - if (comicsModel->rowCount() == 0) + if (comicsModel->rowCount() == 0) { comicsViewsManager->showNoSearchResultsView(); - else + disableComicsActions(true); + } else { comicsViewsManager->showComicsView(); + disableComicsActions(false); + } } void LibraryWindow::setFolderSearchFilterData(QMap *filteredItems, FolderItem *root)