on xenial help sign in
Act on review comments
f10d865Michal Hruby
Dash/DashContent.qml+7−5
@@ -105,11 +105,13 @@ Item {
105
105
106 // If the number of items is less than the current index, then need to reset to another item.
106 // If the number of items is less than the current index, then need to reset to another item.
107 onCountChanged: {
107 onCountChanged: {
108+ if (count > 0) {
108− if (count > 0 && currentIndex >= count) {
109+ if (currentIndex >= count) {
109− dashContent.setCurrentScopeAtIndex(count-1, true, true)
110+ dashContent.setCurrentScopeAtIndex(count-1, true, true)
110− } else if (count > 0 && currentIndex < 0) {
111+ } else if (currentIndex < 0) {
111− // setting currentIndex directly, cause we don't want to loose set_current_index
112+ // setting currentIndex directly, cause we don't want to loose set_current_index
112− dashContent.currentIndex = 0
113+ dashContent.currentIndex = 0
114+ }
113 }
115 }
114 }
116 }
115
117
tests/qmltests/Dash/tst_DashContent.qml+1−1
@@ -136,7 +136,7 @@ Item {
136 verify(dashContentList != undefined)
136 verify(dashContentList != undefined)
137
137
138 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
138 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
139− compare(dashContentList.currentIndex, -1, "DashContent's currentIndex should be -1 while there are no items in the model");
139+ compare(dashContentList.currentIndex, -1, "DashContent's currentIndex should be -1 while there have been no items in the model");
140
140
141 tryCompare(scopeLoadedSpy, "count", 5);
141 tryCompare(scopeLoadedSpy, "count", 5);
142
142