on xenial help sign in
Fix crash and test

Don't crash in case someone made a mistake and set the display range to show stuff negative Also fix the test to do it and then "not do it" anymore

commit83382c53fa75f62a6243ed68cb5fd0ed0e2ffc3a authorAlbert Astals <albert.astals@canonical.com> dateThu 22 May 2014, 15:37 (12 years ago) parent1564e33
2 files changed+8
plugins/Dash/abstractdashview.cpp+3 tests/plugins/Dash/organicgridtest.cpp+5
plugins/Dash/abstractdashview.cpp+3
@@ -176,6 +176,9 @@ void AbstractDashView::refill()
176176
177177bool AbstractDashView::addVisibleItems(qreal fillFromY, qreal fillToY, bool asynchronous)
178178{
179+ if (fillToY <= fillFromY)
180+ return false;
181+
179182 if (!delegate())
180183 return false;
181184
tests/plugins/Dash/organicgridtest.cpp+5
@@ -514,6 +514,11 @@ private Q_SLOTS:
514514
515515 model->setCount(21);
516516
517+ QTRY_COMPARE(grid->m_visibleItems.count(), 0);
518+
519+ grid->setDisplayMarginBeginning(0);
520+ grid->setDisplayMarginEnd(0);
521+
517522 // This is exactly the same block as the first again
518523 checkInitialPositions();
519524 }