Merge lp:~tiagosh/messaging-app/rtm-14.09-fix-1414675 into lp:messaging-app/rtm-14.09

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 208
Merged at revision: 207
Proposed branch: lp:~tiagosh/messaging-app/rtm-14.09-fix-1414675
Merge into: lp:messaging-app/rtm-14.09
Diff against target: 42 lines (+20/-3)
1 file modified
src/qml/ThreadDelegate.qml (+20/-3)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/rtm-14.09-fix-1414675
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+247607@code.launchpad.net

Commit message

Generate filters dynamically using a UnionFilter with all grouped threads.

Description of the change

Generate filters dynamically using a UnionFilter with all grouped threads.

--Checklist--
Are there any related MPs required for this MP to build/function as expected? Please list.
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/messaging-app) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
208. By Tiago Salem Herrmann

change filter to make search more reliable

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Ues

Did CI run pass? If not, please explain why.
Not running on RTM MRs, but I ran the autopilot tests manually and they pass.

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/ThreadDelegate.qml'
2--- src/qml/ThreadDelegate.qml 2015-01-23 20:11:21 +0000
3+++ src/qml/ThreadDelegate.qml 2015-01-27 13:51:49 +0000
4@@ -218,11 +218,18 @@
5 property alias contexts: phoneDetail.contexts
6 property bool isUnknown: contactId === ""
7 property string phoneNumberSubTypeLabel: ""
8- property var searchHistoryFilter: HistoryIntersectionFilter {
9- HistoryFilter { filterProperty: "threadId"; filterValue: model.threadId }
10- HistoryFilter { filterProperty: "accountId"; filterValue: model.accountId }
11+ property string latestFilter: ""
12+ property var searchHistoryFilter
13+ property var searchHistoryFilterString: 'import Ubuntu.History 0.1;
14+ HistoryUnionFilter {
15+ %1
16+ }'
17+ property var searchIntersectionFilter: 'HistoryIntersectionFilter {
18+ HistoryFilter { filterProperty: "accountId"; filterValue: \'%1\' }
19+ HistoryFilter { filterProperty: "threadId"; filterValue: \'%2\' }
20 HistoryFilter { filterProperty: "message"; filterValue: searchTerm; matchFlags: HistoryFilter.MatchContains }
21 }
22+ '
23
24 function updateSearch() {
25 var found = false
26@@ -232,6 +239,16 @@
27 || (!unknownContact && delegateHelper.alias.toLowerCase().search(searchTermLowerCase) !== -1)) {
28 found = true
29 } else {
30+ var componentFilters = ""
31+ for(var i in model.threads) {
32+ componentFilters += searchIntersectionFilter.arg(model.threads[i].accountId).arg(model.threads[i].threadId)
33+ }
34+ var finalString = searchHistoryFilterString.arg(componentFilters)
35+ if (finalString !== latestFilter) {
36+ delegateHelper.searchHistoryFilter = Qt.createQmlObject(finalString, searchEventModelLoader)
37+ latestFilter = finalString
38+ }
39+
40 searchEventModelLoader.active = true
41 }
42 } else {

Subscribers

People subscribed via source and target branches