Changeset View
Changeset View
Standalone View
Standalone View
src/ui/elfmodel/sectionproxymodel.cpp
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | 13 | | |||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "sectionproxymodel.h" | 18 | #include "sectionproxymodel.h" | ||
19 | #include "elfmodel.h" | 19 | #include "elfmodel.h" | ||
20 | 20 | | |||
21 | SectionProxyModel::SectionProxyModel(QObject* parent): KRecursiveFilterProxyModel(parent) | 21 | SectionProxyModel::SectionProxyModel(QObject* parent): QSortFilterProxyModel(parent) | ||
22 | { | 22 | { | ||
23 | setRecursiveFilteringEnabled(true); | ||||
23 | } | 24 | } | ||
24 | 25 | | |||
25 | SectionProxyModel::~SectionProxyModel() = default; | 26 | SectionProxyModel::~SectionProxyModel() = default; | ||
26 | 27 | | |||
27 | bool SectionProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const | 28 | bool SectionProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const | ||
28 | { | 29 | { | ||
29 | const auto sourceIndex = sourceModel()->index(source_row, 0, source_parent); | 30 | const auto sourceIndex = sourceModel()->index(source_row, 0, source_parent); | ||
30 | const auto fileData = sourceModel()->data(sourceIndex, ElfModel::FileRole); | 31 | const auto fileData = sourceModel()->data(sourceIndex, ElfModel::FileRole); | ||
31 | const auto secData = sourceModel()->data(sourceIndex, ElfModel::SectionRole); | 32 | const auto secData = sourceModel()->data(sourceIndex, ElfModel::SectionRole); | ||
32 | if (fileData.isNull() && secData.isNull()) | 33 | if (fileData.isNull() && secData.isNull()) | ||
33 | return false; | 34 | return false; | ||
34 | return KRecursiveFilterProxyModel::filterAcceptsRow(source_row, source_parent); | 35 | return filterAcceptsRow(source_row, source_parent); | ||
vkrause: This causes an infinite recursion when opening a file now, needs to be QSortFilterProxy… | |||||
35 | } | 36 | } |
This causes an infinite recursion when opening a file now, needs to be QSortFilterProxy::filterAcceptsRow.