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

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 283
Merged at revision: 282
Proposed branch: lp:~boiko/messaging-app/remove_multiple_entries
Merge into: lp:messaging-app
Diff against target: 149 lines (+21/-26)
5 files modified
src/qml/MMSDelegate.qml (+3/-9)
src/qml/MainPage.qml (+7/-2)
src/qml/MessagesListView.qml (+6/-2)
src/qml/SMSDelegate.qml (+3/-9)
src/qml/ThreadDelegate.qml (+2/-4)
To merge this branch: bzr merge lp:~boiko/messaging-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+245609@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.
283. By Gustavo Pichorim Boiko

Update copyright headers.

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.
Yes

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/MMSDelegate.qml'
2--- src/qml/MMSDelegate.qml 2014-09-30 19:19:34 +0000
3+++ src/qml/MMSDelegate.qml 2015-01-05 20:35:30 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2012, 2013, 2014 Canonical Ltd.
7+ * Copyright 2012-2015 Canonical Ltd.
8 *
9 * This file is part of messaging-app.
10 *
11@@ -40,10 +40,7 @@
12
13 function deleteMessage()
14 {
15- eventModel.removeEvent(messageData.accountId,
16- messageData.threadId,
17- messageData.eventId,
18- messageData.type)
19+ eventModel.removeEvents([messageData.properties]);
20 }
21
22 function resendMessage()
23@@ -65,10 +62,7 @@
24 attachment.push(item.filePath)
25 newAttachments.push(attachment)
26 }
27- eventModel.removeEvent(messageData.accountId,
28- messageData.threadId,
29- messageData.eventId,
30- messageData.type)
31+ eventModel.removeEvents([messageData.properties]);
32 // FIXME: export this information for MessageDelegate
33 chatManager.sendMMS(participants, textMessage, newAttachments, messages.account.accountId)
34 }
35
36=== modified file 'src/qml/MainPage.qml'
37--- src/qml/MainPage.qml 2014-12-04 13:26:48 +0000
38+++ src/qml/MainPage.qml 2015-01-05 20:35:30 +0000
39@@ -1,5 +1,5 @@
40 /*
41- * Copyright 2012, 2013, 2014 Canonical Ltd.
42+ * Copyright 2012-2015 Canonical Ltd.
43 *
44 * This file is part of messaging-app.
45 *
46@@ -216,12 +216,17 @@
47 }
48 }
49 onSelectionDone: {
50+ var threadsToRemove = [];
51 for (var i=0; i < items.count; i++) {
52 var threads = items.get(i).model.threads
53 for (var j in threads) {
54- threadModel.removeThread(threads[j].accountId, threads[j].threadId, threads[j].type)
55+ threadsToRemove.push(threads[j]);
56 }
57 }
58+
59+ if (threadsToRemove.length > 0) {
60+ threadModel.removeThreads(threadsToRemove);
61+ }
62 }
63 }
64
65
66=== modified file 'src/qml/MessagesListView.qml'
67--- src/qml/MessagesListView.qml 2014-10-07 16:57:03 +0000
68+++ src/qml/MessagesListView.qml 2015-01-05 20:35:30 +0000
69@@ -1,5 +1,5 @@
70 /*
71- * Copyright 2012, 2013, 2014 Canonical Ltd.
72+ * Copyright 2012-2015 Canonical Ltd.
73 *
74 * This file is part of messaging-app.
75 *
76@@ -122,12 +122,16 @@
77
78 onSelectionDone: {
79 var removeDividers = (items.count == eventModel.count)
80+ var events = [];
81 for (var i=0; i < items.count; i++) {
82 var event = items.get(i).model
83 if (!removeDividers && event.textMessageType == HistoryThreadModel.MessageTypeInformation) {
84 continue;
85 }
86- eventModel.removeEvent(event.accountId, event.threadId, event.eventId, event.type)
87+ events.push(event.properties);
88+ }
89+ if (events.length > 0) {
90+ eventModel.removeEvents(events);
91 }
92 }
93
94
95=== modified file 'src/qml/SMSDelegate.qml'
96--- src/qml/SMSDelegate.qml 2014-09-30 19:19:34 +0000
97+++ src/qml/SMSDelegate.qml 2015-01-05 20:35:30 +0000
98@@ -1,5 +1,5 @@
99 /*
100- * Copyright 2012, 2013, 2014 Canonical Ltd.
101+ * Copyright 2012-2015 Canonical Ltd.
102 *
103 * This file is part of messaging-app.
104 *
105@@ -26,10 +26,7 @@
106
107 function deleteMessage()
108 {
109- eventModel.removeEvent(root.messageData.accountId,
110- root.messageData.threadId,
111- root.messageData.eventId,
112- root.messageData.type)
113+ eventModel.removeEvents([root.messageData.properties]);
114 }
115
116 function resendMessage()
117@@ -38,10 +35,7 @@
118 return
119 }
120
121- eventModel.removeEvent(root.messageData.accountId,
122- root.messageData.threadId,
123- root.messageData.eventId,
124- root.messageData.type)
125+ eventModel.removeEvents([root.messageData.properties]);
126 // FIXME: export this information for MessageDelegate
127 chatManager.sendMessage(messages.participants, textMessage, messages.account.accountId)
128 }
129
130=== modified file 'src/qml/ThreadDelegate.qml'
131--- src/qml/ThreadDelegate.qml 2014-10-21 16:17:17 +0000
132+++ src/qml/ThreadDelegate.qml 2015-01-05 20:35:30 +0000
133@@ -1,5 +1,5 @@
134 /*
135- * Copyright 2012-2013 Canonical Ltd.
136+ * Copyright 2012-2015 Canonical Ltd.
137 *
138 * This file is part of messaging-app.
139 *
140@@ -104,9 +104,7 @@
141 iconName: "delete"
142 text: i18n.tr("Delete")
143 onTriggered: {
144- for (var i in threads) {
145- threadModel.removeThread(threads[i].accountId, threads[i].threadId, threads[i].type)
146- }
147+ threadModel.removeThreads(model.threads);
148 }
149 }
150

Subscribers

People subscribed via source and target branches