diff --git a/src/adapters/data_models/library_model/library_proxy_model.cpp b/src/adapters/data_models/library_model/library_proxy_model.cpp index 84dbef15c..d6154268c 100644 --- a/src/adapters/data_models/library_model/library_proxy_model.cpp +++ b/src/adapters/data_models/library_model/library_proxy_model.cpp @@ -96,6 +96,9 @@ bool LibraryProxyModel::filterAcceptsRow(int source_row, { auto index = sourceModel()->index(source_row, 0, source_parent); + if(!getIsFiltering()) + return filterAcceptsFolder(index); + return filterAcceptsTags(index) && filterAcceptsAuthors(index) && filterAcceptsFormat(index) && filterAcceptsStatus(index) && filterAcceptsLanguage(index) && filterAcceptsFolder(index); @@ -119,7 +122,7 @@ void LibraryProxyModel::setFilterRequest(QString authors, QString format, invalidateFilter(); } -bool LibraryProxyModel::getIsFiltering() +bool LibraryProxyModel::getIsFiltering() const { return !m_filterRequest.authors.isEmpty() || !m_filterRequest.format.isEmpty() || @@ -383,8 +386,8 @@ void LibraryProxyModel::setFolderFilter(const QString& newFolder) m_folder = newFolder; - invalidateFilter(); emit folderFilterChanged(); + invalidateFilter(); } } // namespace adapters::data_models diff --git a/src/adapters/data_models/library_model/library_proxy_model.hpp b/src/adapters/data_models/library_model/library_proxy_model.hpp index cb0c93983..e8d04da75 100644 --- a/src/adapters/data_models/library_model/library_proxy_model.hpp +++ b/src/adapters/data_models/library_model/library_proxy_model.hpp @@ -48,7 +48,7 @@ class ADAPTERS_EXPORT LibraryProxyModel : public QSortFilterProxyModel Q_INVOKABLE void setFilterRequest(QString authors, QString format, QString language, bool onlyBooks, bool onlyFiles, bool read, bool unread); - Q_INVOKABLE bool getIsFiltering(); + Q_INVOKABLE bool getIsFiltering() const; Q_INVOKABLE void addFilterTag(QString tag); Q_INVOKABLE void removeFilterTag(QString tag); Q_INVOKABLE void clearFilterTags();