Attempts to debug an issue that causes files to load up with twice the
number of actual frames.
This commit is contained in:
+11
-3
@@ -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
|
//of how many by tracking the number we last knew about as opposed to how many rows there
|
||||||
//are now.
|
//are now.
|
||||||
num = filteredFrames.count() - lastUpdateNumFrames;
|
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 (num == 0 && !overwriteDups) return;
|
||||||
if (filteredFrames.count() == 0) return;
|
if (filteredFrames.count() == 0) return;
|
||||||
|
|
||||||
|
lastUpdateNumFrames += num; //done this way to avoid asking for filteredFrames.count() again
|
||||||
|
|
||||||
qDebug() << "Bulk refresh of " << num;
|
qDebug() << "Bulk refresh of " << num;
|
||||||
|
|
||||||
if (!overwriteDups)
|
if (!overwriteDups)
|
||||||
{
|
{
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
if (num > filteredFrames.count()) num = filteredFrames.count();
|
if (num > filteredFrames.count()) num = filteredFrames.count();
|
||||||
beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1);
|
//qDebug() << "From " << (filteredFrames.count() - num) << " to " << (filteredFrames.count() - 1);
|
||||||
endInsertRows();
|
//beginInsertRows(QModelIndex(), filteredFrames.count() - num, filteredFrames.count() - 1);
|
||||||
|
//endInsertRows();
|
||||||
|
beginResetModel();
|
||||||
|
endResetModel();
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user