aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-11 10:54:49 +0200
committerOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-11 10:54:49 +0200
commit6504ccc25f02b73649c53e22194ebf2d2319e4e5 (patch)
tree58b25e63a33cc204a30bbc4987b2ea3610023c95 /examples
parenta3c6400a93152d5cf4dc63f9c90955f6245ceacd (diff)
parent24faac7a03ce0769ed155bfc71be31f750c86dfb (diff)
downloadqmenumodel-6504ccc25f02b73649c53e22194ebf2d2319e4e5.tar.gz
qmenumodel-6504ccc25f02b73649c53e22194ebf2d2319e4e5.tar.bz2
qmenumodel-6504ccc25f02b73649c53e22194ebf2d2319e4e5.zip
Merge the latest changes from trunk.
Diffstat (limited to 'examples')
-rw-r--r--examples/render-menumodel.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/render-menumodel.qml b/examples/render-menumodel.qml
index 1ad41c5..d7c650e 100644
--- a/examples/render-menumodel.qml
+++ b/examples/render-menumodel.qml
@@ -15,7 +15,11 @@ Item {
busType: DBus.SessionBus
busName: "com.canonical.testmenu"
objectPath: "/com/canonical/testmenu"
- onStatusChanged: console.log("status of menu model changed to", status)
+ onStatusChanged: {
+ if (status == DBus.Connecting) {
+ view.reset()
+ }
+ }
}
ListView {
@@ -28,7 +32,6 @@ Item {
anchors.margins: 10
spacing: 3
model: menuModel
- Component.onCompleted: menuModel.start()
delegate: Rectangle {
width: parent.width
height: 30
@@ -85,6 +88,11 @@ Item {
newback.pop()
view.__back = newback
}
+ function reset() {
+ while (view.__back.length > 0) {
+ goback()
+ }
+ }
}
Rectangle {
@@ -132,5 +140,7 @@ Item {
font.pixelSize: 11
}
}
+
+ Component.onCompleted: menuModel.start()
}