Merge lp:~uriboni/unity-2d/unity-2d-exclude-filter-proxy-model into lp:unity-2d
Proposed by
Ugo Riboni
Status: | Merged |
---|---|
Approved by: | Alberto Mardegan |
Approved revision: | 689 |
Merged at revision: | 702 |
Proposed branch: | lp:~uriboni/unity-2d/unity-2d-exclude-filter-proxy-model |
Merge into: | lp:unity-2d |
Diff against target: |
160 lines (+87/-2) 3 files modified
libunity-2d-private/src/qsortfilterproxymodelqml.cpp (+32/-2) libunity-2d-private/src/qsortfilterproxymodelqml.h (+6/-0) libunity-2d-private/tests/qsortfilterproxymodeltest.cpp (+49/-0) |
To merge this branch: | bzr merge lp:~uriboni/unity-2d/unity-2d-exclude-filter-proxy-model |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Mardegan (community) | Approve | ||
Review via email: mp+73836@code.launchpad.net |
Commit message
Add a new proxy model class that excludes items matching the regexp instead of including them.
Description of the change
Add a new proxy model class that has all the features of QSortFilterProx
This is useful because generally speaking it's pretty hard to use a regular expression to exclude something. That's for example why tools like grep have the -v option to reverse the normal matching behavior.
This class is currently used only by another project but I thought having it in unity-2d would make things easier for everyone when they face a similar task.
To post a comment you must log in.
The code looks fine, but I'd rather add a boolean property (invertMatch) to the existing model than add a subclass.
Hopefully most of the code you wrote for the tests can be reused.