D28468: Add property initializer support to PagePool

2020-04-01 Thread Jonah BrĂ¼chert
This revision was automatically updated to reflect the committed changes.
Closed by commit R169:bb5a6c13ec0b: Add property initializer support to 
PagePool (authored by masonm, committed by jbbgameich).

REPOSITORY
  R169 Kirigami

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D28468?vs=79059&id=79090

REVISION DETAIL
  https://phabricator.kde.org/D28468

AFFECTED FILES
  src/controls/PagePoolAction.qml
  src/pagepool.cpp
  src/pagepool.h

To: masonm, #kirigami, mart
Cc: plasma-devel, mart, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, 
ahiemstra, davidedmundson


D28468: Add property initializer support to PagePool

2020-04-01 Thread Mason McParlane
masonm updated this revision to Diff 79059.
masonm added a comment.


  - Rename variable and add comment

REPOSITORY
  R169 Kirigami

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D28468?vs=79005&id=79059

BRANCH
  add-pagepool-properties (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D28468

AFFECTED FILES
  src/controls/PagePoolAction.qml
  src/pagepool.cpp
  src/pagepool.h

To: masonm, #kirigami, mart
Cc: plasma-devel, mart, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, 
ahiemstra, davidedmundson


D28468: Add property initializer support to PagePool

2020-04-01 Thread Marco Martin
mart added a comment.


  almost good, just two minor nitpicks

INLINE COMMENTS

> PagePoolAction.qml:57
> +  */
> +property var properties
> +

initialProperties

> pagepool.cpp:160
> +
> +class PropertyInitializingIncubator : public QQmlIncubator
> +{

put a comment that as soon we can depend from Qt 5.14 we should remove this 
incubator and use QQmlComponent::createWithInitialProperties instead

REPOSITORY
  R169 Kirigami

REVISION DETAIL
  https://phabricator.kde.org/D28468

To: masonm, #kirigami, mart
Cc: plasma-devel, mart, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, 
ahiemstra, davidedmundson


D28468: Add property initializer support to PagePool

2020-03-31 Thread Mason McParlane
masonm created this revision.
masonm added reviewers: Kirigami, mart.
Herald added a project: Kirigami.
masonm requested review of this revision.

REVISION SUMMARY
  Currently PagePool allows pages to be pushed onto the stack but there
  is no way to pass initialization properties to the newly-created
  page. This change adds support for this, and also provides
  asynchronous object creation to speed things up a bit.

TEST PLAN
  After running the following main.qml the page stack will first
  push a page with the default title "NO PROPERTIES" because it
  invokes the no-property behavior. Afterward the same page gets
  pushed on the stack but this time it sets the title to
  "PROPERTIES" using the passed-in properties object.
  
  // main.qml
  Kirigami.ApplicationWindow {
  
id: window

Kirigami.PagePool {
  id: pool
}

Kirigami.PagePoolAction {
  id: noprops

  text: "Action with props"
  pagePool: pool
  pageStack: window.pageStack
  page: "qrc:/TestPage.qml?hasProps=" + false
}
Kirigami.PagePoolAction {
  id: props

  text: "Action with props"
  pagePool: pool
  pageStack: window.pageStack
  page: "qrc:/TestPage.qml?hasProps=" + true
  properties: { title: "PROPERTIES" }
}

Component.onCompleted: {
  noprops.trigger()
  props.trigger()
}
  
  }
  
  // TestPage.qml
  Kirigami.Page {
  
title: "NO PROPERTIES"
  
  }

REPOSITORY
  R169 Kirigami

BRANCH
  add-pagepool-properties (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D28468

AFFECTED FILES
  src/controls/PagePoolAction.qml
  src/pagepool.cpp
  src/pagepool.h

To: masonm, #kirigami, mart
Cc: plasma-devel, mart, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, 
ahiemstra, davidedmundson