Merge lp:~boiko/dialer-app/remove_multiple_entries into lp:dialer-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 331
Merged at revision: 329
Proposed branch: lp:~boiko/dialer-app/remove_multiple_entries
Merge into: lp:dialer-app
Diff against target: 71 lines (+13/-12)
2 files modified
src/qml/HistoryPage/HistoryDetailsPage.qml (+3/-5)
src/qml/HistoryPage/HistoryPage.qml (+10/-7)
To merge this branch: bzr merge lp:~boiko/dialer-app/remove_multiple_entries
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+245608@code.launchpad.net

Commit message

Remove multiple entries all at once instead of using multiple calls.

Description of the change

Remove multiple entries all at once instead of using multiple calls.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
Yes: https://code.launchpad.net/~boiko/history-service/remove_multiple_entries/+merge/245607

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/<package-name>) 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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
330. By Gustavo Pichorim Boiko

Remove all the grouped entries.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
331. By Gustavo Pichorim Boiko

Fix multiselection deleting.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Looks good.

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

Did CI run pass? If not, please explain why.
No, not related to the change

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

review: Approve
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

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

Did CI run pass? If not, please explain why.
No, not related to the change

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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/HistoryPage/HistoryDetailsPage.qml'
2--- src/qml/HistoryPage/HistoryDetailsPage.qml 2014-11-13 14:39:51 +0000
3+++ src/qml/HistoryPage/HistoryDetailsPage.qml 2015-01-07 19:47:44 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2014 Canonical Ltd.
7+ * Copyright 2014-2015 Canonical Ltd.
8 *
9 * This file is part of dialer-app.
10 *
11@@ -73,9 +73,7 @@
12 iconName: "delete"
13 text: i18n.tr("Delete")
14 onTriggered: {
15- for (var i in events) {
16- eventModel.removeEvent(events[i].accountId, events[i].threadId, events[i].eventId, events[i].type);
17- }
18+ eventModel.removeEvents(events);
19 pageStack.pop();
20 }
21 }
22@@ -239,7 +237,7 @@
23 text: i18n.tr("Delete")
24 onTriggered: {
25 // remove from the history service
26- eventModel.removeEvent(modelData.accountId, modelData.threadId, modelData.eventId, modelData.type)
27+ eventModel.removeEvents([modelData]);
28
29 // as this page only displays an array of events, we need to update manually
30 // the list of displayed events
31
32=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
33--- src/qml/HistoryPage/HistoryPage.qml 2014-11-13 14:39:35 +0000
34+++ src/qml/HistoryPage/HistoryPage.qml 2015-01-07 19:47:44 +0000
35@@ -1,5 +1,5 @@
36 /*
37- * Copyright 2012-2013 Canonical Ltd.
38+ * Copyright 2012-2015 Canonical Ltd.
39 *
40 * This file is part of dialer-app.
41 *
42@@ -191,9 +191,15 @@
43 listModel: historyEventModel
44
45 onSelectionDone: {
46+ var events = [];
47 for (var i=0; i < items.count; i++) {
48- var event = items.get(i).model
49- historyEventModel.removeEvent(event.accountId, event.threadId, event.eventId, event.type)
50+ var eventGroup = items.get(i).model.events
51+ for (var j in eventGroup) {
52+ events.push(eventGroup[j]);
53+ }
54+ }
55+ if (events.length > 0) {
56+ historyEventModel.removeEvents(events)
57 }
58 }
59 onIsInSelectionModeChanged: {
60@@ -308,10 +314,7 @@
61 iconName: "delete"
62 text: i18n.tr("Delete")
63 onTriggered: {
64- var events = model.events;
65- for (var i in events) {
66- historyEventModel.removeEvent(events[i].accountId, events[i].threadId, events[i].eventId, events[i].type)
67- }
68+ historyEventModel.removeEvents(model.events)
69 }
70 }
71 property bool knownNumber: participants[0] != "x-ofono-private" && participants[0] != "x-ofono-unknown"

Subscribers

People subscribed via source and target branches