Bug 318336

Summary: PageStack: pop() doesn't delete page
Product: [Unmaintained] plasma4 Reporter: Michael Zanetti <mzanetti>
Component: qml-componentsAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: notmart
Priority: NOR    
Version: 4.10.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Michael Zanetti 2013-04-14 12:45:50 UTC
pop()ing a Page from a PageStack doesn't delete the page. As PageStack's push() does either create the page or reparents any given items, it should also take care about deleting them.

Reproducible: Always
Comment 1 Marco Martin 2013-07-13 18:11:38 UTC
the code right now of pagestack does one of the following things:
if the page has been created, it should be deleted
if the page has been reparented, it should give again the old parent.

what is your case? do you already have th page instantiated or you pass just the component?
(changing the behaviour of always deleting could also make sense)
Comment 2 Michael Zanetti 2013-07-14 08:30:59 UTC
Right... I changed the code to not have a parent and indeed it seems to delete the page when popping. So this bug report actually does not report a bug in the techincal sense, but reveals a mismatch with all the other PageStack apis.

The reason I tapped into this, was because this application runs already on Harmattan, Symbian and Ubuntu touch and all of those PageStacks are unconditionally destroying the page upon popping.

I think it would make sense to change the API to always delete the page because this is how also Qt works. Once you reparent an QObject, the meta object code will take care about its destruction. So to be consistent with C++/Qt and other component API's I'd vote for changing it.
Comment 3 Marco Martin 2013-07-14 10:11:06 UTC
Git commit 934a3de43fd7d94d884eaf6fcffd6d7815902721 by Marco Martin.
Committed on 14/07/2013 at 10:09.
Pushed by mart into branch 'KDE/4.11'.

always delete the page after a pop()

this makes the component behave the same as the stack in components of meego, ubutu and QtControls

M  +0    -6    plasma/declarativeimports/plasmacomponents/qml/PageStack.qml

http://commits.kde.org/kde-runtime/934a3de43fd7d94d884eaf6fcffd6d7815902721
Comment 4 Marco Martin 2013-07-14 10:11:48 UTC
in 4.11 and master the behavior should be uniform with other platforms now