Changeset View
Changeset View
Standalone View
Standalone View
gui/ksortfilterproxymodel.cpp
Show All 36 Lines | |||||
37 | KSortFilterProxyModel::KSortFilterProxyModel(QObject * parent) | 37 | KSortFilterProxyModel::KSortFilterProxyModel(QObject * parent) | ||
38 | : QSortFilterProxyModel(parent), d_ptr( new KSortFilterProxyModelPrivate ) | 38 | : QSortFilterProxyModel(parent), d_ptr( new KSortFilterProxyModelPrivate ) | ||
39 | { | 39 | { | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | KSortFilterProxyModel::~KSortFilterProxyModel() | 42 | KSortFilterProxyModel::~KSortFilterProxyModel() | ||
43 | { | 43 | { | ||
44 | delete d_ptr; | 44 | delete d_ptr; | ||
45 | d_ptr = nullptr; | ||||
45 | } | 46 | } | ||
46 | 47 | | |||
47 | bool KSortFilterProxyModel::filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const | 48 | bool KSortFilterProxyModel::filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const | ||
48 | { | 49 | { | ||
49 | if( filterRegExp().isEmpty() ) return true; //Shortcut for common case | 50 | if( filterRegExp().isEmpty() ) return true; //Shortcut for common case | ||
50 | 51 | | |||
51 | if( QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent) ) | 52 | if( QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent) ) | ||
52 | return true; | 53 | return true; | ||
Show All 23 Lines | |||||
76 | } | 77 | } | ||
77 | void KSortFilterProxyModel::setShowAllChildren(bool showAllChildren) | 78 | void KSortFilterProxyModel::setShowAllChildren(bool showAllChildren) | ||
78 | { | 79 | { | ||
79 | if(showAllChildren == d_ptr->showAllChildren) | 80 | if(showAllChildren == d_ptr->showAllChildren) | ||
80 | return; | 81 | return; | ||
81 | d_ptr->showAllChildren = showAllChildren; | 82 | d_ptr->showAllChildren = showAllChildren; | ||
82 | invalidateFilter(); | 83 | invalidateFilter(); | ||
83 | } | 84 | } | ||
84 | |