Minor refactoring.

This commit is contained in:
Nodir Temirkhodjaev 2018-02-23 14:56:52 +05:00
parent 2227614032
commit 7b03e56576
4 changed files with 14 additions and 5 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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)

View File

@ -50,6 +50,7 @@ private:
void cancelAsyncIo();
LogBuffer *getFreeBuffer();
void addFreeBuffer(LogBuffer *logBuffer);
void readLogEntries(LogBuffer *logBuffer);