[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: small fix to mobile components
From: Dirk Hohndel <dirk () hohndel ! org>
Date: 2016-01-27 18:15:33
Message-ID: 20160127181533.GV2141 () rrmbpvm ! gr8dns ! org
[Download RAW message or body]
In certain cases the existing code would access an index past the end of
the pageStack
/D
["0001-Don-t-access-past-the-last-element-of-the-pageStack.patch" (text/x-diff)]
From b7097228532e41cf2efe772fb922d51c7ab72f69 Mon Sep 17 00:00:00 2001
From: Dirk Hohndel <dirk@hohndel.org>
Date: Wed, 27 Jan 2016 07:05:35 -0800
Subject: [PATCH] Don't access past the last element of the pageStack
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
---
components/mobilecomponents/qml/PageRow.qml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/components/mobilecomponents/qml/PageRow.qml \
b/components/mobilecomponents/qml/PageRow.qml index 50cf77bde7e4..c331ee5dfdbb 100644
--- a/components/mobilecomponents/qml/PageRow.qml
+++ b/components/mobilecomponents/qml/PageRow.qml
@@ -153,7 +153,9 @@ Item {
if (isNaN(mainFlickable.contentX)) {
return;
}
- actualRoot.lastVisiblePage = \
Engine.pageStack[Math.floor((mainFlickable.contentX + mainFlickable.width - \
1)/columnWidth)].page; + var lastIdx = \
Math.min(Engine.pageStack.length-1, Math.floor((mainFlickable.contentX + \
mainFlickable.width - 1)/columnWidth)) + actualRoot.lastVisiblePage = \
Engine.pageStack[lastIdx].page; +
if (!actualRoot.lastVisiblePage) {
actualRoot.lastVisiblePage = actualRoot.currentPage;
}
--
2.7.0
[Attachment #4 (text/plain)]
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic