Commit 0f938d5 1 parent 64aefc7 commit 0f938d5 Copy full SHA for 0f938d5
File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1201,30 +1201,37 @@ void ThumbsViewer::scanForSort(UserRoles role) {
1201
1201
1202
1202
void ThumbsViewer::loadThumbsRange () {
1203
1203
static bool isInProgress = false ;
1204
- static int currentRowCount;
1205
- int currThumb;
1206
1204
1207
1205
if (isInProgress) {
1208
1206
isAbortThumbsLoading = true ;
1209
1207
QTimer::singleShot (0 , this , SLOT (loadThumbsRange ()));
1210
1208
return ;
1211
1209
}
1212
1210
1211
+ int currentRowCount = m_model->rowCount ();
1212
+ if (!currentRowCount)
1213
+ return ;
1214
+
1213
1215
isInProgress = true ;
1214
- currentRowCount = m_model->rowCount ();
1215
1216
1216
1217
QElapsedTimer timer;
1217
1218
timer.start ();
1218
1219
1219
1220
for (bool fastOnly : { true , false }) {
1221
+ int currThumb;
1220
1222
for (scrolledForward ? currThumb = thumbsRangeFirst : currThumb = thumbsRangeLast;
1221
1223
(scrolledForward ? currThumb <= thumbsRangeLast : currThumb >= thumbsRangeFirst);
1222
1224
scrolledForward ? ++currThumb : --currThumb) {
1223
1225
1224
1226
if (isAbortThumbsLoading || m_model->rowCount () != currentRowCount || currThumb < 0 )
1225
1227
break ;
1226
1228
1227
- if (m_model->item (currThumb)->data (LoadedRole).toBool ())
1229
+ QStandardItem *item = m_model->item (currThumb);
1230
+ if (!item) {
1231
+ qDebug () << " meek" << m_model->rowCount () << currentRowCount << currThumb << thumbsRangeFirst << thumbsRangeLast << scrolledForward;
1232
+ continue ;
1233
+ }
1234
+ if (item->data (LoadedRole).toBool ())
1228
1235
continue ;
1229
1236
1230
1237
loadThumb (currThumb, fastOnly);
You can’t perform that action at this time.
0 commit comments