Merge lp:~ahayzen/music-app/fix-console-errors-parent-changed-helpers into lp:music-app

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 891
Merged at revision: 891
Proposed branch: lp:~ahayzen/music-app/fix-console-errors-parent-changed-helpers
Merge into: lp:music-app
Diff against target: 61 lines (+9/-10)
2 files modified
app/ui/SongsView.qml (+6/-10)
debian/changelog (+3/-0)
To merge this branch: bzr merge lp:~ahayzen/music-app/fix-console-errors-parent-changed-helpers
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+265920@code.launchpad.net

Commit message

* Fix for console errors when the parent change helpers are called

Description of the change

* Fix for console errors when the parent change helpers are called

TESTING:
At step 5 below there is now no console error and I've fixed other potential places this could occur

1) Start the app
2) Goto albums
3) Select an album
4) Select play all
5) Notice in the console an error like the following
file:///home/andy/Workspace/ubuntu/music-app/app/ui/SongsView.qml:91: TypeError: Cannot read property 'title' of undefined

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

PASSED: Continuous integration, rev:891
http://91.189.93.70:8080/job/music-app-ci/1351/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/music-app-vivid-amd64-ci/203

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/music-app-ci/1351/rebuild

review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

lgtm! Tested and verified there are no other such instances in this file.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ui/SongsView.qml'
2--- app/ui/SongsView.qml 2015-07-24 02:09:59 +0000
3+++ app/ui/SongsView.qml 2015-07-26 22:50:31 +0000
4@@ -54,7 +54,7 @@
5 property bool loaded: false // used to detect difference between first and further loads
6
7 onVisibleChanged: {
8- if (page !== undefined && page.childrenChanged) {
9+ if (page && page.childrenChanged) {
10 page.childrenChanged = false
11 refreshWaitTimer.start()
12 }
13@@ -68,7 +68,7 @@
14 if (songStackPage.visible) {
15 albumTracksModel.filterPlaylistTracks(line2)
16 covers = Playlists.getPlaylistCovers(line2)
17- } else {
18+ } else if (songStackPage.page) {
19 songStackPage.page.childrenChanged = true;
20 }
21 }
22@@ -88,10 +88,8 @@
23 function recentChangedHelper()
24 {
25 // if parent Recent then set changed otherwise refilter
26- if (songStackPage.page.title === i18n.tr("Recent")) {
27- if (songStackPage.page !== undefined) {
28- songStackPage.page.changed = true
29- }
30+ if (songStackPage.page && songStackPage.page.title === i18n.tr("Recent")) {
31+ songStackPage.page.changed = true
32 } else {
33 recentModel.filterRecent()
34 }
35@@ -102,10 +100,8 @@
36 force = force === undefined ? false : force // default force to false
37
38 // if parent Playlists then set changed otherwise refilter
39- if (songStackPage.page.title === i18n.tr("Playlists")) {
40- if (songStackPage.page !== undefined) {
41- songStackPage.page.changed = true
42- }
43+ if (songStackPage.page && songStackPage.page.title === i18n.tr("Playlists")) {
44+ songStackPage.page.changed = true
45 } else {
46 playlistModel.filterPlaylists()
47 }
48
49=== modified file 'debian/changelog'
50--- debian/changelog 2015-07-25 04:42:52 +0000
51+++ debian/changelog 2015-07-26 22:50:31 +0000
52@@ -4,6 +4,9 @@
53 * Fix SongsView album art for albums and genres (LP: #1477366)
54 * Fix to allow the LibraryEmptyState to work again (LP: #1478162)
55
56+ [ Andrew Hayzen ]
57+ * Fix for console errors when using the parent changed helpers
58+
59 -- Victor Thompson <victor.thompson@gmail.com> Thu, 23 Jul 2015 21:08:38 -0500
60
61 music-app (2.2) vivid; urgency=medium

Subscribers

People subscribed via source and target branches