From 8cdf6914389a2ef378a013a42b4ed346273be86f Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 31 Jul 2012 15:03:01 +0200 Subject: [PATCH] Don't warn when using a page without toolbar Check if the tools are null before before using the toolbar. REVIEW: 105803 --- declarativeimports/plasmacomponents/qml/ToolBar.qml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/ToolBar.qml b/declarativeimports/plasmacomponents/qml/ToolBar.qml index f5633568e..9ecd95efb 100644 --- a/declarativeimports/plasmacomponents/qml/ToolBar.qml +++ b/declarativeimports/plasmacomponents/qml/ToolBar.qml @@ -117,11 +117,13 @@ Item{ } containerA.current = !containerA.current - tools.parent = newContainer - tools.visible = true - tools.anchors.left = newContainer.left - tools.anchors.right = newContainer.right - tools.anchors.verticalCenter = newContainer.verticalCenter + if(tools) { + tools.parent = newContainer + tools.visible = true + tools.anchors.left = newContainer.left + tools.anchors.right = newContainer.right + tools.anchors.verticalCenter = newContainer.verticalCenter + } switch (transition) { case "push":