diff options
author | Caroline Chao <caroline.chao@digia.com> | 2014-10-13 10:10:32 +0200 |
---|---|---|
committer | Caroline Chao <caroline.chao@digia.com> | 2014-10-13 10:24:09 +0200 |
commit | 517145ffe26d4e06b5c55403226a0619f7674f4a (patch) | |
tree | 277d0f883dfc09352421ad326bfc1d3e3adbc608 | |
parent | 8e6a165827f8933a06f400b9bc542efbcc16222d (diff) |
Fix optimization in getTimeRange
Change-Id: Ifa0753f0ad54c4fd75414071fc9c077c550da8c4
Reviewed-by: Niels Weber <niels.weber@digia.com>
-rw-r--r-- | qml/components/TrackSwitcher.qml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qml/components/TrackSwitcher.qml b/qml/components/TrackSwitcher.qml index d570a1c..1a19307 100644 --- a/qml/components/TrackSwitcher.qml +++ b/qml/components/TrackSwitcher.qml @@ -134,9 +134,9 @@ Rectangle { var needOneMoreItem = halfModelCount * 2 !== modelCountAfterStart for (var i = 1; i < halfModelCount; i++) { - var time1 = model.data(i, "start") + var time1 = model.data(i*2 - 1, "start") setFirstEvent(time1) - var time2 = model.data(i+1, "start") + var time2 = model.data(i*2, "start") setFirstEvent(time2) time = time1 < time2 ? time1 : time2 @@ -145,8 +145,8 @@ Rectangle { if (timeHours < earliestHours ) earliestTime = time - time1 = model.data(i, "end") - time2 = model.data(i+1, "end") + time1 = model.data(i*2 - 1, "end") + time2 = model.data(i*2, "end") time = time1 < time2 ? time2 : time1 timeHours = Functions.getHour(time, isEndTime) latestHours = Functions.getHour(latestTime, isEndTime) |