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
1=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
2--- src/imports/ContactEdit/ContactEditor.qml 2013-08-28 17:06:38 +0000
3+++ src/imports/ContactEdit/ContactEditor.qml 2013-09-11 22:41:24 +0000
4@@ -199,6 +199,13 @@
5 onContactsChanged: {
6 if (saving) {
7 pageStack.pop()
8+ } else if (contactEditor.contact) {
9+ for (var i=0; i < contactEditor.model.contacts.length; i++) {
10+ if (contactEditor.model.contacts[i].contactId == contactEditor.contact.contactId) {
11+ return
12+ }
13+ }
14+ pageStack.pop()
15 }
16 }
17
18
19=== modified file 'src/imports/ContactView/ContactFetch.qml'
20--- src/imports/ContactView/ContactFetch.qml 2013-07-08 18:35:17 +0000
21+++ src/imports/ContactView/ContactFetch.qml 2013-09-11 22:41:24 +0000
22@@ -25,6 +25,7 @@
23 property bool contactIsDirty: false
24
25 signal contactFetched(QtObject contact)
26+ signal contactRemoved()
27
28 function fetchContact(contactId) {
29 if (contact && !contactIsDirty) {
30@@ -44,6 +45,13 @@
31 onContactsChanged: {
32 if (root.contact) {
33 root.contactIsDirty = true
34+
35+ for (var i=0; i < root.model.contacts.length; i++) {
36+ if (root.model.contacts[i].contactId == root.contact.contactId) {
37+ return
38+ }
39+ }
40+ contactRemoved()
41 }
42 }
43 }
44
45=== modified file 'src/imports/ContactView/ContactView.qml'
46--- src/imports/ContactView/ContactView.qml 2013-08-28 17:06:38 +0000
47+++ src/imports/ContactView/ContactView.qml 2013-09-11 22:41:24 +0000
48@@ -130,6 +130,8 @@
49
50 ContactFetch {
51 id: contactFetch
52+
53+ onContactRemoved: pageStack.pop()
54 }
55
56 tools: ToolbarItems {

Subscribers

People subscribed via source and target branches