Merge lp:~phablet-team/gallery-app/delete-album-on-cancel-add into lp:gallery-app

Proposed by Ugo Riboni
Status: Merged
Approved by: Arthur Mello
Approved revision: 1103
Merged at revision: 1103
Proposed branch: lp:~phablet-team/gallery-app/delete-album-on-cancel-add
Merge into: lp:gallery-app
Diff against target: 61 lines (+19/-2)
3 files modified
rc/qml/AlbumEditor/AlbumEditor.qml (+1/-1)
rc/qml/AlbumEditor/AlbumEditorAnimated.qml (+4/-0)
tests/autopilot/gallery_app/tests/test_albums_view.py (+14/-1)
To merge this branch: bzr merge lp:~phablet-team/gallery-app/delete-album-on-cancel-add
Reviewer Review Type Date Requested Status
Arthur Mello (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+238129@code.launchpad.net

Commit message

Delete the new empty album if the album editor is closed by clicking outside of the album cover

Description of the change

Delete the new empty album if the album editor is closed by clicking outside of the album cover

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Arthur Mello (artmello) wrote :

lgtm.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/AlbumEditor/AlbumEditor.qml'
2--- rc/qml/AlbumEditor/AlbumEditor.qml 2014-09-06 21:08:57 +0000
3+++ rc/qml/AlbumEditor/AlbumEditor.qml 2014-10-13 10:33:43 +0000
4@@ -132,7 +132,7 @@
5 onWidthChanged: resetEditorRect()
6 onHeightChanged: resetEditorRect()
7
8- AlbumCollectionModel {
9+ property AlbumCollectionModel model: AlbumCollectionModel {
10 id: albumModel
11 }
12
13
14=== modified file 'rc/qml/AlbumEditor/AlbumEditorAnimated.qml'
15--- rc/qml/AlbumEditor/AlbumEditorAnimated.qml 2014-05-19 13:28:40 +0000
16+++ rc/qml/AlbumEditor/AlbumEditorAnimated.qml 2014-10-13 10:33:43 +0000
17@@ -71,6 +71,10 @@
18
19 onCloseRequested: {
20 root.isOpen = false;
21+ if (album && album.newAlbum && album.containedCount == 0) {
22+ inner_albumEditor.model.destroyAlbum(album);
23+ album = null;
24+ }
25 if (album) {
26 inner_albumEditorTransition.exitEditor(album, root.origin);
27 } else {
28
29=== modified file 'tests/autopilot/gallery_app/tests/test_albums_view.py'
30--- tests/autopilot/gallery_app/tests/test_albums_view.py 2014-08-27 02:41:33 +0000
31+++ tests/autopilot/gallery_app/tests/test_albums_view.py 2014-10-13 10:33:43 +0000
32@@ -68,8 +68,10 @@
33
34 def test_add_album_and_cancel(self):
35 """Add one album, cancel it and checks if the number of albums does
36- not change
37+ not change. Do this in the two different ways we have to cancel editing.
38 """
39+
40+ # Cancel by pressing back in the header
41 albums = self.albums_view.number_of_albums_in_albums_view()
42 self.main_view.get_header().click_action_button("addButton")
43 editor = self.app.select_single(album_editor.AlbumEditor)
44@@ -80,6 +82,17 @@
45 Eventually(Equals(albums))
46 )
47
48+ # Cancel by clicking outside of the album cover
49+ self.main_view.get_header().click_action_button("addButton")
50+ editor = self.app.select_single(album_editor.AlbumEditor)
51+ editor.ensure_fully_open()
52+ editor.close()
53+
54+ self.assertThat(
55+ lambda: self.albums_view.number_of_albums_in_albums_view(),
56+ Eventually(Equals(albums))
57+ )
58+
59 # Check if Camera Button is not visible at Desktop mode
60 def test_camera_button_visible(self):
61 cameraButtonVisible = self.check_header_button_exist("cameraButton")

Subscribers

People subscribed via source and target branches

to all changes: