-
Notifications
You must be signed in to change notification settings - Fork 58
Replaced invalidateFilter #1100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,7 @@ PlacesProxyModel::~PlacesProxyModel() { | |
| void PlacesProxyModel::restoreHiddenItems(const QSet<QString>& items) { | ||
| // hidden items should be restored only once | ||
| if(!hiddenItemsRestored_ && !items.isEmpty()) { | ||
| beginFilterChange(); | ||
| hidden_.clear(); | ||
| QSet<QString>::const_iterator i = items.constBegin(); | ||
| while (i != items.constEnd()) { | ||
|
|
@@ -59,11 +60,12 @@ void PlacesProxyModel::restoreHiddenItems(const QSet<QString>& items) { | |
| ++i; | ||
| } | ||
| hiddenItemsRestored_ = true; | ||
| invalidateFilter(); | ||
| endFilterChange(); | ||
| } | ||
| } | ||
|
|
||
| void PlacesProxyModel::setHidden(const QString& str, bool hide) { | ||
| beginFilterChange(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't do this work when tired as now...
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we rise Qt version in this PR too? |
||
| if(hide) { | ||
| if(!str.isEmpty()) { | ||
| hidden_ << str; | ||
|
|
@@ -72,12 +74,13 @@ void PlacesProxyModel::setHidden(const QString& str, bool hide) { | |
| else { | ||
| hidden_.remove(str); | ||
| } | ||
| invalidateFilter(); | ||
| endFilterChange(); | ||
| } | ||
|
|
||
| void PlacesProxyModel::showAll(bool show) { | ||
| beginFilterChange(); | ||
| showAll_ = show; | ||
| invalidateFilter(); | ||
| endFilterChange(); | ||
| } | ||
|
|
||
| bool PlacesProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes should be done between
beginFilterChange()andendFilterChange(), like this:And also in the other cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done hopefully right.