diff --git a/src/ui/log/logbuffer.cpp b/src/ui/log/logbuffer.cpp index 4b7465ff..72a6e30b 100644 --- a/src/ui/log/logbuffer.cpp +++ b/src/ui/log/logbuffer.cpp @@ -14,6 +14,12 @@ LogBuffer::LogBuffer(int bufferSize, QObject *parent) : { } +void LogBuffer::reset(int top) +{ + m_top = top; + m_offset = 0; +} + char *LogBuffer::output() { return m_array.data() + m_top; diff --git a/src/ui/log/logbuffer.h b/src/ui/log/logbuffer.h index 7e564bb8..3d194b4b 100644 --- a/src/ui/log/logbuffer.h +++ b/src/ui/log/logbuffer.h @@ -36,10 +36,7 @@ public: signals: public slots: - void reset(int top = 0) { - m_top = top; - m_offset = 0; - } + void reset(int top = 0); private: char *output(); diff --git a/src/ui/log/logmanager.cpp b/src/ui/log/logmanager.cpp index 66396cfa..003ef33a 100644 --- a/src/ui/log/logmanager.cpp +++ b/src/ui/log/logmanager.cpp @@ -75,6 +75,11 @@ LogBuffer *LogManager::getFreeBuffer() } } +void LogManager::addFreeBuffer(LogBuffer *logBuffer) +{ + m_freeBuffers.append(logBuffer); +} + void LogManager::processLogBuffer(LogBuffer *logBuffer, bool success, const QString &errorMessage) { @@ -89,7 +94,7 @@ void LogManager::processLogBuffer(LogBuffer *logBuffer, bool success, setErrorMessage(errorMessage); } - m_freeBuffers.append(logBuffer); + addFreeBuffer(logBuffer); } void LogManager::readLogEntries(LogBuffer *logBuffer) diff --git a/src/ui/log/logmanager.h b/src/ui/log/logmanager.h index b3937f97..18d65f49 100644 --- a/src/ui/log/logmanager.h +++ b/src/ui/log/logmanager.h @@ -50,6 +50,7 @@ private: void cancelAsyncIo(); LogBuffer *getFreeBuffer(); + void addFreeBuffer(LogBuffer *logBuffer); void readLogEntries(LogBuffer *logBuffer);