Merge lp:~renatofilho/address-book-app/fix-1222994 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 64
Merged at revision: 70
Proposed branch: lp:~renatofilho/address-book-app/fix-1222994
Merge into: lp:address-book-app
Diff against target: 56 lines (+17/-0)
3 files modified
src/imports/ContactEdit/ContactEditor.qml (+7/-0)
src/imports/ContactView/ContactFetch.qml (+8/-0)
src/imports/ContactView/ContactView.qml (+2/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1222994
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+185177@code.launchpad.net

Commit message

Cancel contact view/edit if contact removed from contact list.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
--- src/imports/ContactEdit/ContactEditor.qml 2013-08-28 17:06:38 +0000
+++ src/imports/ContactEdit/ContactEditor.qml 2013-09-11 22:41:24 +0000
@@ -199,6 +199,13 @@
199 onContactsChanged: {199 onContactsChanged: {
200 if (saving) {200 if (saving) {
201 pageStack.pop()201 pageStack.pop()
202 } else if (contactEditor.contact) {
203 for (var i=0; i < contactEditor.model.contacts.length; i++) {
204 if (contactEditor.model.contacts[i].contactId == contactEditor.contact.contactId) {
205 return
206 }
207 }
208 pageStack.pop()
202 }209 }
203 }210 }
204211
205212
=== modified file 'src/imports/ContactView/ContactFetch.qml'
--- src/imports/ContactView/ContactFetch.qml 2013-07-08 18:35:17 +0000
+++ src/imports/ContactView/ContactFetch.qml 2013-09-11 22:41:24 +0000
@@ -25,6 +25,7 @@
25 property bool contactIsDirty: false25 property bool contactIsDirty: false
2626
27 signal contactFetched(QtObject contact)27 signal contactFetched(QtObject contact)
28 signal contactRemoved()
2829
29 function fetchContact(contactId) {30 function fetchContact(contactId) {
30 if (contact && !contactIsDirty) {31 if (contact && !contactIsDirty) {
@@ -44,6 +45,13 @@
44 onContactsChanged: {45 onContactsChanged: {
45 if (root.contact) {46 if (root.contact) {
46 root.contactIsDirty = true47 root.contactIsDirty = true
48
49 for (var i=0; i < root.model.contacts.length; i++) {
50 if (root.model.contacts[i].contactId == root.contact.contactId) {
51 return
52 }
53 }
54 contactRemoved()
47 }55 }
48 }56 }
49 }57 }
5058
=== modified file 'src/imports/ContactView/ContactView.qml'
--- src/imports/ContactView/ContactView.qml 2013-08-28 17:06:38 +0000
+++ src/imports/ContactView/ContactView.qml 2013-09-11 22:41:24 +0000
@@ -130,6 +130,8 @@
130130
131 ContactFetch {131 ContactFetch {
132 id: contactFetch132 id: contactFetch
133
134 onContactRemoved: pageStack.pop()
133 }135 }
134136
135 tools: ToolbarItems {137 tools: ToolbarItems {

Subscribers

People subscribed via source and target branches