mirror of
https://github.com/tnodir/fort
synced 2024-11-15 07:25:18 +00:00
Minor refactoring.
This commit is contained in:
parent
2227614032
commit
7b03e56576
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
void cancelAsyncIo();
|
||||
|
||||
LogBuffer *getFreeBuffer();
|
||||
void addFreeBuffer(LogBuffer *logBuffer);
|
||||
|
||||
void readLogEntries(LogBuffer *logBuffer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user