diff --git a/canframemodel.cpp b/canframemodel.cpp index ed8f17a..98385cf 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -362,19 +362,27 @@ void CANFrameModel::sendBulkRefresh(int num) //of how many by tracking the number we last knew about as opposed to how many rows there //are now. num = filteredFrames.count() - lastUpdateNumFrames; - lastUpdateNumFrames += num; //done this way to avoid asking for filteredFrames.count() again + + if (num < 0) return; + + //qDebug() << "Num: " << num; if (num == 0 && !overwriteDups) return; if (filteredFrames.count() == 0) return; + lastUpdateNumFrames += num; //done this way to avoid asking for filteredFrames.count() again + qDebug() << "Bulk refresh of " << num; if (!overwriteDups) { mutex.lock(); if (num > filteredFrames.count()) num = filteredFrames.count(); - beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1); - endInsertRows(); + //qDebug() << "From " << (filteredFrames.count() - num) << " to " << (filteredFrames.count() - 1); + //beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1); + //endInsertRows(); + beginResetModel(); + endResetModel(); mutex.unlock(); } else