From f97c21fb841471f699529febfdf7215804b2dbba Mon Sep 17 00:00:00 2001 From: HerrKermet Date: Tue, 26 Sep 2023 22:18:55 +0200 Subject: [PATCH] Fixed rare segmentationFault on startup Still TODO in context_table_proxy_model.cpp in filterAcceptRows. --- .../models/context_table_proxy_model.cpp | 3 ++- plugins/gui/src/searchbar/search_proxy_model.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/gui/src/context_manager_widget/models/context_table_proxy_model.cpp b/plugins/gui/src/context_manager_widget/models/context_table_proxy_model.cpp index c8d82977b73..2fb3d55297d 100644 --- a/plugins/gui/src/context_manager_widget/models/context_table_proxy_model.cpp +++ b/plugins/gui/src/context_manager_widget/models/context_table_proxy_model.cpp @@ -13,8 +13,9 @@ namespace hal bool ContextTableProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const { - QList columns = mSearchOptions.getColumns(); + //TODO somehow the program crashes with segfault if this method ever returns a false at the initial start + QList columns = mSearchOptions.getColumns(); //TODO get column count if(columns.empty()){ diff --git a/plugins/gui/src/searchbar/search_proxy_model.cpp b/plugins/gui/src/searchbar/search_proxy_model.cpp index 4b9a5cf33c8..38961fc2962 100644 --- a/plugins/gui/src/searchbar/search_proxy_model.cpp +++ b/plugins/gui/src/searchbar/search_proxy_model.cpp @@ -4,7 +4,7 @@ namespace hal { SearchProxyModel::SearchProxyModel(QObject* parent): QSortFilterProxyModel(parent) { - mSearchOptions = SearchOptions(); + mSearchOptions = SearchOptions(8); } void SearchProxyModel::startSearch(QString text, int options)