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.

This commit is contained in:
electron128 2016-01-09 12:09:43 +01:00
parent a118870db9
commit b125cb1f1e

View File

@ -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);