Fix ordering of live entries in logs
parent
9a47457a15
commit
6c3674cec7
|
|
@ -459,15 +459,15 @@ void NewLogsModel::newLogEntryReceived(const QVariantMap &map)
|
||||||
qCritical() << "New entry!" << m_sources << source << m_sampleRate;
|
qCritical() << "New entry!" << m_sources << source << m_sampleRate;
|
||||||
NewLogEntry *entry = new NewLogEntry(source, timestamp, values, this);
|
NewLogEntry *entry = new NewLogEntry(source, timestamp, values, this);
|
||||||
if (m_sortOrder == Qt::DescendingOrder) {
|
if (m_sortOrder == Qt::DescendingOrder) {
|
||||||
beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
|
|
||||||
m_list.append(entry);
|
|
||||||
endInsertRows();
|
|
||||||
emit entriesAdded(m_list.count() - 1, {entry});
|
|
||||||
} else {
|
|
||||||
beginInsertRows(QModelIndex(), 0, 0);
|
beginInsertRows(QModelIndex(), 0, 0);
|
||||||
m_list.prepend(entry);
|
m_list.prepend(entry);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
emit entriesAdded(0, {entry});
|
emit entriesAdded(0, {entry});
|
||||||
|
} else {
|
||||||
|
beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
|
||||||
|
m_list.append(entry);
|
||||||
|
endInsertRows();
|
||||||
|
emit entriesAdded(m_list.count() - 1, {entry});
|
||||||
}
|
}
|
||||||
emit countChanged();
|
emit countChanged();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue