Merge lp:~phablet-team/messaging-app/remove_apl_workarounds into lp:messaging-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 578
Merged at revision: 582
Proposed branch: lp:~phablet-team/messaging-app/remove_apl_workarounds
Merge into: lp:messaging-app
Prerequisite: lp:~fboucault/messaging-app/async_bottom_edge
Diff against target: 421 lines (+51/-139)
10 files modified
src/qml/MMS/Previewer.qml (+3/-3)
src/qml/MMS/PreviewerMultipleContacts.qml (+1/-1)
src/qml/MMSDelegate.qml (+1/-1)
src/qml/MainPage.qml (+2/-4)
src/qml/Messages.qml (+1/-1)
src/qml/MessagingContactEditorPage.qml (+1/-1)
src/qml/MessagingContactViewPage.qml (+5/-4)
src/qml/MessagingPageLayout.qml (+0/-85)
src/qml/NewRecipientPage.qml (+3/-3)
src/qml/messaging-app.qml (+34/-36)
To merge this branch: bzr merge lp:~phablet-team/messaging-app/remove_apl_workarounds
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
system-apps-ci-bot continuous-integration Approve
Review via email: mp+300615@code.launchpad.net

This proposal supersedes a proposal from 2016-07-19.

Commit message

Now that AdaptivePageLayout supports loading pages synchronously and that the memory management bugs are fixed, remove the workarounds from the app.

Description of the change

Now that AdaptivePageLayout supports loading pages synchronously and that the memory management bugs are fixed, remove the workarounds from the app.

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:575
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/58/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1002/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1002
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/900
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/900
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/900
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/894/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/894
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/894/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/894
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/894/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/894/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/894
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/894/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/894
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/894/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/894/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/894
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/894/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/894
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/894/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/58/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:576
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/59/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1005/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1005
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/903
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/903
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/903
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/897/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/897
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/897/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/897
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/897/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/897/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/897
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/897/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/897
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/897/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/897/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/897
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/897/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/897
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/897/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/59/rebuild

review: Needs Fixing (continuous-integration)
577. By Gustavo Pichorim Boiko

Merge trunk

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:577
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/60/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1019
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/193
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1019
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/917
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/917
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/917
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/911/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/911
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/911/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/60/rebuild

review: Approve (continuous-integration)
578. By Gustavo Pichorim Boiko

Merge parent

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:578
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/66/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1037
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/203
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1037
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/933
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/933
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/933
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/927/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/927
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/927/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-app-ci/66/rebuild

review: Approve (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

nice to get rid of these workarounds.
Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MMS/Previewer.qml'
2--- src/qml/MMS/Previewer.qml 2016-04-21 04:15:31 +0000
3+++ src/qml/MMS/Previewer.qml 2016-07-25 17:14:08 +0000
4@@ -63,7 +63,7 @@
5 iconName: "back"
6 shortcut: "Esc"
7 onTriggered: {
8- mainStack.removePage(previewerPage)
9+ mainStack.removePages(previewerPage)
10 }
11 }
12 ]
13@@ -133,11 +133,11 @@
14
15 onPeerSelected: {
16 picker.curTransfer = peer.request();
17- mainStack.removePage(picker);
18+ mainStack.removePages(picker);
19 if (picker.curTransfer.state === ContentTransfer.InProgress)
20 picker.__exportItems(picker.url);
21 }
22- onCancelPressed: mainStack.removePage(picker);
23+ onCancelPressed: mainStack.removePages(picker);
24 }
25
26 Connections {
27
28=== modified file 'src/qml/MMS/PreviewerMultipleContacts.qml'
29--- src/qml/MMS/PreviewerMultipleContacts.qml 2016-04-21 04:15:31 +0000
30+++ src/qml/MMS/PreviewerMultipleContacts.qml 2016-07-25 17:14:08 +0000
31@@ -58,7 +58,7 @@
32 property var contact: thumbnail.vcard.contacts[index]
33
34 onClicked: {
35- mainStack.addComponentToCurrentColumnSync(root, sigleContatPreviewer, {'contact': contact})
36+ mainStack.addPageToCurrentColumn(root, sigleContatPreviewer, {'contact': contact})
37 }
38 }
39 }
40
41=== modified file 'src/qml/MMSDelegate.qml'
42--- src/qml/MMSDelegate.qml 2016-06-28 20:21:42 +0000
43+++ src/qml/MMSDelegate.qml 2016-07-25 17:14:08 +0000
44@@ -45,7 +45,7 @@
45 var properties = {}
46 properties["attachment"] = attachment.item.attachment
47 properties["thumbnail"] = attachment.item
48- mainStack.addFileToCurrentColumnSync(messages.basePage, Qt.resolvedUrl(attachment.item.previewer), properties)
49+ mainStack.addPageToCurrentColumn(messages.basePage, Qt.resolvedUrl(attachment.item.previewer), properties)
50 }
51 }
52
53
54=== modified file 'src/qml/MainPage.qml'
55--- src/qml/MainPage.qml 2016-07-08 13:46:54 +0000
56+++ src/qml/MainPage.qml 2016-07-25 17:14:08 +0000
57@@ -96,8 +96,7 @@
58 text: i18n.tr("Settings")
59 iconName: "settings"
60 onTriggered: {
61- emptyStack(false)
62- pageStack.addFileToNextColumnSync(mainPage, Qt.resolvedUrl("SettingsPage.qml"))
63+ pageStack.addPageToNextColumn(mainPage, Qt.resolvedUrl("SettingsPage.qml"))
64 }
65 },
66 Action {
67@@ -282,8 +281,7 @@
68 if (displayedEvent != null) {
69 properties["scrollToEventId"] = displayedEvent.eventId
70 }
71- emptyStack(false)
72- mainStack.addComponentToNextColumnSync(mainPage, messagesWithBottomEdge, properties)
73+ mainStack.addPageToNextColumn(mainPage, messagesWithBottomEdge, properties)
74
75 // mark this item as current
76 threadList.currentIndex = index
77
78=== modified file 'src/qml/Messages.qml'
79--- src/qml/Messages.qml 2016-07-13 20:42:55 +0000
80+++ src/qml/Messages.qml 2016-07-25 17:14:08 +0000
81@@ -676,7 +676,7 @@
82 iconName: "contact"
83 onTriggered: {
84 Qt.inputMethod.hide()
85- mainStack.addFileToCurrentColumnSync(messages.basePage, Qt.resolvedUrl("NewRecipientPage.qml"), {"multiRecipient": multiRecipient})
86+ mainStack.addPageToCurrentColumn(messages.basePage, Qt.resolvedUrl("NewRecipientPage.qml"), {"multiRecipient": multiRecipient})
87 }
88 }
89
90
91=== modified file 'src/qml/MessagingContactEditorPage.qml'
92--- src/qml/MessagingContactEditorPage.qml 2016-06-20 12:22:19 +0000
93+++ src/qml/MessagingContactEditorPage.qml 2016-07-25 17:14:08 +0000
94@@ -55,7 +55,7 @@
95 onContactSaved: {
96 if (root.contactListPage) {
97 if (root.contactListPage.phoneToAdd !== "") {
98- mainStack.removePage(root.contactListPage)
99+ mainStack.removePages(root.contactListPage)
100 } else {
101 root.contactListPage.moveListToContact(contact)
102 root.contactListPage.phoneToAdd = ""
103
104=== modified file 'src/qml/MessagingContactViewPage.qml'
105--- src/qml/MessagingContactViewPage.qml 2016-02-01 20:10:42 +0000
106+++ src/qml/MessagingContactViewPage.qml 2016-07-25 17:14:08 +0000
107@@ -35,6 +35,7 @@
108 readonly property string contactEditorPageURL: Qt.resolvedUrl("MessagingContactEditorPage.qml")
109 property string addPhoneToContact: ""
110 property var contactListPage: null
111+ model: null
112
113 function addPhoneToContactImpl(contact, phoneNumber)
114 {
115@@ -62,7 +63,7 @@
116 iconName: "share"
117 visible: root.editable
118 onTriggered: {
119- pageStack.addComponentToCurrentColumnSync(root, contactShareComponent,
120+ pageStack.addPageToCurrentColumn(root, contactShareComponent,
121 { contactModel: root.model,
122 contacts: [root.contact] })
123 }
124@@ -73,7 +74,7 @@
125 iconName: "edit"
126 visible: root.editable
127 onTriggered: {
128- pageStack.addFileToCurrentColumnSync(root, contactEditorPageURL,
129+ pageStack.addPageToCurrentColumn(root, contactEditorPageURL,
130 { model: root.model,
131 contact: root.contact,
132 contactListPage: root.contactListPage })
133@@ -123,9 +124,9 @@
134 } else {
135 Qt.openUrlExternally(("%1:%2").arg(action).arg(detail.value(0)))
136 }
137- pageStack.removePage(root)
138+ pageStack.removePages(root)
139 }
140- onContactRemoved: pageStack.removePage(root)
141+ onContactRemoved: pageStack.removePages(root)
142 onContactFetched: {
143 root.contact = contact
144 if (root.active && root.addPhoneToContact != "") {
145
146=== removed file 'src/qml/MessagingPageLayout.qml'
147--- src/qml/MessagingPageLayout.qml 2016-05-02 18:35:28 +0000
148+++ src/qml/MessagingPageLayout.qml 1970-01-01 00:00:00 +0000
149@@ -1,85 +0,0 @@
150-/*
151- * Copyright 2016 Canonical Ltd.
152- *
153- * This file is part of messaging-app.
154- *
155- * messaging-app is free software; you can redistribute it and/or modify
156- * it under the terms of the GNU General Public License as published by
157- * the Free Software Foundation; version 3.
158- *
159- * messaging-app is distributed in the hope that it will be useful,
160- * but WITHOUT ANY WARRANTY; without even the implied warranty of
161- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
162- * GNU General Public License for more details.
163- *
164- * You should have received a copy of the GNU General Public License
165- * along with this program. If not, see <http://www.gnu.org/licenses/>.
166- */
167-
168-import QtQuick 2.0
169-import Ubuntu.Components 1.3
170-
171-AdaptivePageLayout {
172- id: layout
173- property var _pagesToRemove: []
174-
175- layouts: PageColumnsLayout {
176- when: mainStack.width >= units.gu(90)
177- PageColumn {
178- maximumWidth: units.gu(50)
179- minimumWidth: units.gu(40)
180- preferredWidth: units.gu(40)
181- }
182- PageColumn {
183- fillWidth: true
184- }
185- }
186-
187-
188- function deleteInstances() {
189- for (var i in _pagesToRemove) {
190- if (_pagesToRemove[i].destroy) {
191- _pagesToRemove[i].destroy()
192- }
193- }
194- _pagesToRemove = []
195- }
196-
197- function removePage(page) {
198- // check if this page was allocated dynamically and then remove it
199- for (var i in _pagesToRemove) {
200- if (_pagesToRemove[i] == page) {
201- _pagesToRemove[i].destroy()
202- _pagesToRemove.splice(i, 1)
203- break
204- }
205- }
206- removePages(page)
207- }
208-
209- function addFileToNextColumnSync(parentObject, resolvedUrl, properties) {
210- addComponentToNextColumnSync(parentObject, Qt.createComponent(resolvedUrl), properties)
211- }
212-
213- function addFileToCurrentColumnSync(parentObject, resolvedUrl, properties) {
214- addComponentToCurrentColumnSync(parentObject, Qt.createComponent(resolvedUrl), properties)
215- }
216-
217- function addComponentToNextColumnSync(parentObject, component, properties) {
218- if (typeof(properties) === 'undefined') {
219- properties = {}
220- }
221- var page = component.createObject(parentObject, properties)
222- layout.addPageToNextColumn(parentObject, page)
223- _pagesToRemove.push(page)
224- }
225-
226- function addComponentToCurrentColumnSync(parentObject, component, properties) {
227- if (typeof(properties) === 'undefined') {
228- properties = {}
229- }
230- var page = component.createObject(parentObject, properties)
231- layout.addPageToCurrentColumn(parentObject, page)
232- _pagesToRemove.push(page)
233- }
234-}
235
236=== modified file 'src/qml/NewRecipientPage.qml'
237--- src/qml/NewRecipientPage.qml 2016-06-21 00:56:52 +0000
238+++ src/qml/NewRecipientPage.qml 2016-07-25 17:14:08 +0000
239@@ -43,7 +43,7 @@
240 {
241 multiRecipient.addRecipient(phoneNumber)
242 multiRecipient.forceActiveFocus()
243- mainStack.removePage(newRecipientPage)
244+ mainStack.removePages(newRecipientPage)
245 }
246
247 header: PageHeader {
248@@ -64,7 +64,7 @@
249 text: i18n.tr("Back")
250 iconName: "back"
251 onTriggered: {
252- mainStack.removePage(newRecipientPage)
253+ mainStack.removePages(newRecipientPage)
254 newRecipientPage.destroy()
255 }
256 }
257@@ -190,7 +190,7 @@
258
259 onAddNewContactClicked: {
260 var newContact = ContactsJS.createEmptyContact(newRecipientPage.phoneToAdd, newRecipientPage)
261- mainStack.addFileToCurrentColumnSync(newRecipientPage,
262+ mainStack.addPageToCurrentColumn(newRecipientPage,
263 Qt.resolvedUrl("MessagingContactEditorPage.qml"),
264 { model: contactList.listModel,
265 contact: newContact,
266
267=== modified file 'src/qml/messaging-app.qml'
268--- src/qml/messaging-app.qml 2016-07-21 19:47:04 +0000
269+++ src/qml/messaging-app.qml 2016-07-25 17:14:08 +0000
270@@ -105,8 +105,13 @@
271 }
272
273 function showContactDetails(currentPage, contact, contactListPage, contactsModel) {
274- var initialProperties = { "contactListPage": contactListPage,
275- "model": contactsModel}
276+ var initialProperties = {}
277+ if (contactListPage) {
278+ initialProperties["contactListPage"] = contactListPage
279+ }
280+ if (contactsModel) {
281+ initialProperties["model"] = contactsModel
282+ }
283
284 if (typeof(contact) == 'string') {
285 initialProperties['contactId'] = contact
286@@ -114,34 +119,30 @@
287 initialProperties['contact'] = contact
288 }
289
290- mainStack.addFileToCurrentColumnSync(currentPage,
291+ mainStack.addPageToCurrentColumn(currentPage,
292 Qt.resolvedUrl("MessagingContactViewPage.qml"),
293 initialProperties)
294 }
295
296- function addNewContact(currentPage, phoneNumber, contactListPage) {
297- mainStack.addFileToCurrentColumnSync(currentPage,
298- Qt.resolvedUrl("MessagingContactEditorPage.qml"),
299- { "contactId": contactId,
300- "addPhoneToContact": phoneNumber,
301- "contactListPage": contactListPage })
302- }
303-
304 function addPhoneToContact(currentPage, contact, phoneNumber, contactListPage, contactsModel) {
305 if (contact === "") {
306- mainStack.addFileToCurrentColumnSync(currentPage,
307+ mainStack.addPageToCurrentColumn(currentPage,
308 Qt.resolvedUrl("NewRecipientPage.qml"),
309 { "phoneToAdd": phoneNumber })
310 } else {
311- var initialProperties = { "addPhoneToContact": phoneNumber,
312- "contactListPage": contactListPage,
313- "model": contactsModel }
314+ var initialProperties = { "addPhoneToContact": phoneNumber }
315+ if (contactListPage) {
316+ initialProperties["contactListPage"] = contactListPage
317+ }
318+ if (contactsModel) {
319+ initialProperties["model"] = contactsModel
320+ }
321 if (typeof(contact) == 'string') {
322 initialProperties['contactId'] = contact
323 } else {
324 initialProperties['contact'] = contact
325 }
326- mainStack.addFileToCurrentColumnSync(currentPage,
327+ mainStack.addPageToCurrentColumn(currentPage,
328 Qt.resolvedUrl("MessagingContactViewPage.qml"),
329 initialProperties)
330 }
331@@ -288,8 +289,7 @@
332 function emptyStack(showEmpty) {
333 if (typeof showEmpty === 'undefined') { showEmpty = true; }
334 mainView.emptyStackRequested()
335- mainStack.removePage(mainPage)
336- layout.deleteInstances()
337+ mainStack.removePages(mainPage)
338 if (showEmpty) {
339 showEmptyState()
340 }
341@@ -298,7 +298,7 @@
342
343 function showEmptyState() {
344 if (mainStack.columns > 1 && !application.findMessagingChild("emptyStatePage")) {
345- layout.addComponentToNextColumnSync(mainPage, emptyStatePageComponent)
346+ layout.addPageToNextColumn(mainPage, emptyStatePageComponent)
347 }
348 }
349
350@@ -351,7 +351,7 @@
351 emptyStack(false)
352 // FIXME: AdaptivePageLayout takes a really long time to create pages,
353 // so we create manually and push that
354- mainStack.addComponentToNextColumnSync(mainPage, messagesWithBottomEdge, properties)
355+ mainStack.addPageToNextColumn(mainPage, messagesWithBottomEdge, properties)
356 }
357
358 InputInfo {
359@@ -409,30 +409,17 @@
360 id: emptyStatePage
361 objectName: "emptyStatePage"
362
363- function deleteMe() {
364- emptyStatePage.destroy(1)
365- emptyStatePage.objectName = ""
366- }
367-
368 Connections {
369 target: layout
370 onColumnsChanged: {
371 if (layout.columns == 1) {
372- emptyStatePage.deleteMe()
373 if (!application.findMessagingChild("fakeItem")) {
374- layout.removePage(mainPage)
375+ emptyStack()
376 }
377 }
378 }
379 }
380
381- Connections {
382- target: mainView
383- onEmptyStackRequested: {
384- emptyStatePage.deleteMe()
385- }
386- }
387-
388 EmptyState {
389 labelVisible: false
390 }
391@@ -455,9 +442,21 @@
392 }
393 }
394
395- MessagingPageLayout {
396+ AdaptivePageLayout {
397 id: layout
398 anchors.fill: parent
399+ layouts: PageColumnsLayout {
400+ when: mainStack.width >= units.gu(90)
401+ PageColumn {
402+ maximumWidth: units.gu(50)
403+ minimumWidth: units.gu(40)
404+ preferredWidth: units.gu(40)
405+ }
406+ PageColumn {
407+ fillWidth: true
408+ }
409+ }
410+ asynchronous: false
411 primaryPage: MainPage {
412 id: mainPage
413 }
414@@ -467,7 +466,6 @@
415 onColumnsChanged: {
416 // we only have things to do here in case no thread is selected
417 if (layout.completed && layout.columns == 2 && !application.findMessagingChild("emptyStatePage") && !application.findMessagingChild("fakeItem")) {
418- layout.removePage(mainPage)
419 emptyStack()
420 }
421 }

Subscribers

People subscribed via source and target branches

to all changes: