added mutexes

This commit is contained in:
Jan Käberich 2022-11-01 01:12:04 +01:00
parent 22542a81b6
commit 5ace021e41
14 changed files with 112 additions and 21 deletions

View file

@ -82,9 +82,18 @@ void DeviceUSBLogView::updateTree()
ui->tree->setColumnCount(4);
ui->tree->setHeaderLabels({"Timestamp","Source","Type","Content"});
for(auto &e : log.getEntries()) {
addEntry(e);
unsigned int i=0;
try {
// will throw once all entries have been added (number of entries may change while the loop is running)
for(i=0;;i++) {
addEntry(log.getEntry(i));
}
} catch (...) {
}
QString status = "Log contains "+QString::number(i) + " entries, using ";
status += Unit::ToString(log.getUsedStorageSize(), "B", " kMG") + " (maximum: "+Unit::ToString(log.getMaxStorageSize(), "B", " kMG")+")";
ui->status->setText(status);
}
void DeviceUSBLogView::addEntry(const DeviceUSBLog::LogEntry &e)