From b125cb1f1e9f911cb6a274bdd92e24a4295fb1cc Mon Sep 17 00:00:00 2001 From: electron128 Date: Sat, 9 Jan 2016 12:09:43 +0100 Subject: [PATCH] fix the bug where a filter is applied in friends file list even if view mode is tree and search box is hidden. Problem was: SharedFilesDialog::FilterItems() is called from multiple places. The check if we should filter or not is now in the filter function itself. --- retroshare-gui/src/gui/SharedFilesDialog.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index cfe4c11d9..d75606bd9 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -363,10 +363,7 @@ void SharedFilesDialog::changeCurrentViewModel(int viewTypeIndex) ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal, COLUMN_NAME, COLUMN_DIR) ; -#ifdef DONT_USE_SEARCH_IN_TREE_VIEW - if(viewTypeIndex == VIEW_TYPE_FLAT) -#endif - FilterItems(); + FilterItems(); } void LocalSharedFilesDialog::showProperColumns() @@ -1017,6 +1014,11 @@ void SharedFilesDialog::startFilter() void SharedFilesDialog::FilterItems() { +#ifdef DONT_USE_SEARCH_IN_TREE_VIEW + if(proxyModel == tree_proxyModel) + return; +#endif + QString text = ui.filterPatternLineEdit->text(); setCursor(Qt::WaitCursor);