Implement method to update buffer in QMap

This commit is contained in:
Salanto 2021-08-24 00:05:48 +02:00
parent 58a751afb0
commit b7308c18fb

View File

@ -58,9 +58,17 @@ void ULogger::logConnectionAttempt(ConnectionLog f_log)
}
void ULogger::updateAreaBuffer(const QString &f_area, const QString &f_entry)
void ULogger::updateAreaBuffer(const QString& f_area, const QString& f_entry)
{
QQueue<QString>f_buffer = m_bufferMap.value(f_area);
if (f_buffer.length() < ConfigManager::logBuffer()) {
f_buffer.enqueue(f_entry);
}
else {
f_buffer.dequeue();
f_buffer.enqueue(f_entry);
}
m_bufferMap.insert(f_area, f_buffer);
}
QQueue<QString> ULogger::buffer(const QString& f_areaName)