on xenial help sign in
Reset instead of qFatal when removing things from the middle
8da3202Albert Astals Cid
plugins/Dash/horizontaljournal.cpp+3−1
@@ -199,7 +199,9 @@ void HorizontalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change>
199 m_lastInRowIndexPosition.remove(indexToRemove);
199 m_lastInRowIndexPosition.remove(indexToRemove);
200 } else {
200 } else {
201 if (indexToRemove < lastIndex) {
201 if (indexToRemove < lastIndex) {
202− qFatal("HorizontalJournal only supports removal from the end of the model");
202+ qDebug() << "HorizontalJournal only supports removal from the end of the model, resetting instead";
203+ cleanupExistingItems();
204+ break;
203 } else {
205 } else {
204 setImplicitHeightDirty();
206 setImplicitHeightDirty();
205 }
207 }
plugins/Dash/organicgrid.cpp+3−1
@@ -250,7 +250,9 @@ void OrganicGrid::processModelRemoves(const QVector<QQmlChangeSet::Change> &remo
250 releaseItem(m_visibleItems.takeLast());
250 releaseItem(m_visibleItems.takeLast());
251 } else {
251 } else {
252 if (indexToRemove < lastIndex) {
252 if (indexToRemove < lastIndex) {
253− qFatal("OrganicGrid only supports removal from the end of the model");
253+ qDebug() << "OrganicGrid only supports removal from the end of the model, resetting instead";
254+ cleanupExistingItems();
255+ break;
254 }
256 }
255 }
257 }
256 }
258 }
plugins/Dash/verticaljournal.cpp+3−1
@@ -265,7 +265,9 @@ void VerticalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change> &
265 }
265 }
266 if (!found) {
266 if (!found) {
267 if (indexToRemove < lastCreatedIndex) {
267 if (indexToRemove < lastCreatedIndex) {
268− qFatal("VerticalJournal only supports removal from the end of the model");
268+ qDebug() << "VerticalJournal only supports removal from the end of the model, resetting instead";
269+ cleanupExistingItems();
270+ break;
269 } else {
271 } else {
270 setImplicitHeightDirty();
272 setImplicitHeightDirty();
271 }
273 }