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
=== modified file 'src/qml/MMSDelegate.qml'
--- src/qml/MMSDelegate.qml 2014-09-30 19:19:34 +0000
+++ src/qml/MMSDelegate.qml 2015-01-05 20:35:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012, 2013, 2014 Canonical Ltd.2 * Copyright 2012-2015 Canonical Ltd.
3 *3 *
4 * This file is part of messaging-app.4 * This file is part of messaging-app.
5 *5 *
@@ -40,10 +40,7 @@
4040
41 function deleteMessage()41 function deleteMessage()
42 {42 {
43 eventModel.removeEvent(messageData.accountId,43 eventModel.removeEvents([messageData.properties]);
44 messageData.threadId,
45 messageData.eventId,
46 messageData.type)
47 }44 }
4845
49 function resendMessage()46 function resendMessage()
@@ -65,10 +62,7 @@
65 attachment.push(item.filePath)62 attachment.push(item.filePath)
66 newAttachments.push(attachment)63 newAttachments.push(attachment)
67 }64 }
68 eventModel.removeEvent(messageData.accountId,65 eventModel.removeEvents([messageData.properties]);
69 messageData.threadId,
70 messageData.eventId,
71 messageData.type)
72 // FIXME: export this information for MessageDelegate66 // FIXME: export this information for MessageDelegate
73 chatManager.sendMMS(participants, textMessage, newAttachments, messages.account.accountId)67 chatManager.sendMMS(participants, textMessage, newAttachments, messages.account.accountId)
74 }68 }
7569
=== modified file 'src/qml/MainPage.qml'
--- src/qml/MainPage.qml 2014-12-04 13:26:48 +0000
+++ src/qml/MainPage.qml 2015-01-05 20:35:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012, 2013, 2014 Canonical Ltd.2 * Copyright 2012-2015 Canonical Ltd.
3 *3 *
4 * This file is part of messaging-app.4 * This file is part of messaging-app.
5 *5 *
@@ -216,12 +216,17 @@
216 }216 }
217 }217 }
218 onSelectionDone: {218 onSelectionDone: {
219 var threadsToRemove = [];
219 for (var i=0; i < items.count; i++) {220 for (var i=0; i < items.count; i++) {
220 var threads = items.get(i).model.threads221 var threads = items.get(i).model.threads
221 for (var j in threads) {222 for (var j in threads) {
222 threadModel.removeThread(threads[j].accountId, threads[j].threadId, threads[j].type)223 threadsToRemove.push(threads[j]);
223 }224 }
224 }225 }
226
227 if (threadsToRemove.length > 0) {
228 threadModel.removeThreads(threadsToRemove);
229 }
225 }230 }
226 }231 }
227232
228233
=== modified file 'src/qml/MessagesListView.qml'
--- src/qml/MessagesListView.qml 2014-10-07 16:57:03 +0000
+++ src/qml/MessagesListView.qml 2015-01-05 20:35:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012, 2013, 2014 Canonical Ltd.2 * Copyright 2012-2015 Canonical Ltd.
3 *3 *
4 * This file is part of messaging-app.4 * This file is part of messaging-app.
5 *5 *
@@ -122,12 +122,16 @@
122122
123 onSelectionDone: {123 onSelectionDone: {
124 var removeDividers = (items.count == eventModel.count)124 var removeDividers = (items.count == eventModel.count)
125 var events = [];
125 for (var i=0; i < items.count; i++) {126 for (var i=0; i < items.count; i++) {
126 var event = items.get(i).model127 var event = items.get(i).model
127 if (!removeDividers && event.textMessageType == HistoryThreadModel.MessageTypeInformation) {128 if (!removeDividers && event.textMessageType == HistoryThreadModel.MessageTypeInformation) {
128 continue;129 continue;
129 }130 }
130 eventModel.removeEvent(event.accountId, event.threadId, event.eventId, event.type)131 events.push(event.properties);
132 }
133 if (events.length > 0) {
134 eventModel.removeEvents(events);
131 }135 }
132 }136 }
133137
134138
=== modified file 'src/qml/SMSDelegate.qml'
--- src/qml/SMSDelegate.qml 2014-09-30 19:19:34 +0000
+++ src/qml/SMSDelegate.qml 2015-01-05 20:35:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012, 2013, 2014 Canonical Ltd.2 * Copyright 2012-2015 Canonical Ltd.
3 *3 *
4 * This file is part of messaging-app.4 * This file is part of messaging-app.
5 *5 *
@@ -26,10 +26,7 @@
2626
27 function deleteMessage()27 function deleteMessage()
28 {28 {
29 eventModel.removeEvent(root.messageData.accountId,29 eventModel.removeEvents([root.messageData.properties]);
30 root.messageData.threadId,
31 root.messageData.eventId,
32 root.messageData.type)
33 }30 }
3431
35 function resendMessage()32 function resendMessage()
@@ -38,10 +35,7 @@
38 return35 return
39 }36 }
4037
41 eventModel.removeEvent(root.messageData.accountId,38 eventModel.removeEvents([root.messageData.properties]);
42 root.messageData.threadId,
43 root.messageData.eventId,
44 root.messageData.type)
45 // FIXME: export this information for MessageDelegate39 // FIXME: export this information for MessageDelegate
46 chatManager.sendMessage(messages.participants, textMessage, messages.account.accountId)40 chatManager.sendMessage(messages.participants, textMessage, messages.account.accountId)
47 }41 }
4842
=== modified file 'src/qml/ThreadDelegate.qml'
--- src/qml/ThreadDelegate.qml 2014-10-21 16:17:17 +0000
+++ src/qml/ThreadDelegate.qml 2015-01-05 20:35:30 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2012-2013 Canonical Ltd.2 * Copyright 2012-2015 Canonical Ltd.
3 *3 *
4 * This file is part of messaging-app.4 * This file is part of messaging-app.
5 *5 *
@@ -104,9 +104,7 @@
104 iconName: "delete"104 iconName: "delete"
105 text: i18n.tr("Delete")105 text: i18n.tr("Delete")
106 onTriggered: {106 onTriggered: {
107 for (var i in threads) {107 threadModel.removeThreads(model.threads);
108 threadModel.removeThread(threads[i].accountId, threads[i].threadId, threads[i].type)
109 }
110 }108 }
111 }109 }
112110

Subscribers

People subscribed via source and target branches