From 08e323af598896b422caab607893441a0387cc47 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 13 Jul 2018 09:36:09 +0200 Subject: Avoid warnings --- framework/qml/View.qml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'framework/qml/View.qml') diff --git a/framework/qml/View.qml b/framework/qml/View.qml index d74fb4c0..d8e32fab 100644 --- a/framework/qml/View.qml +++ b/framework/qml/View.qml @@ -27,7 +27,7 @@ FocusScope { id: root //Search - property rect searchArea: null + property rect searchArea property string filter: "" property var searchObject: null function triggerSearch() { @@ -51,7 +51,7 @@ FocusScope { } //View columns - property int visibleViews: 2 + property int visibleViews: 0 //0 means the feature is disabled entirely property int currentIndex: 0 property int count: contentItems.length default property alias contentItems: content.data @@ -94,14 +94,19 @@ FocusScope { } function showRelevantSplits() { + if (!visibleViews) { + return + } var i; for (i = 0; i < count; i++) { - if (i < currentIndex) { - contentItems[i].visible = false; - } else if (i > (currentIndex + visibleViews - 1)) { - contentItems[i].visible = false; - } else { - contentItems[i].visible = true; + if ('visible' in contentItems[i]) { + if (i < currentIndex) { + contentItems[i].visible = false; + } else if (i > (currentIndex + visibleViews - 1)) { + contentItems[i].visible = false; + } else { + contentItems[i].visible = true; + } } } -- cgit v1.2.3