diff --git a/GUI/host/textthread.cc b/GUI/host/textthread.cc index 88390e6..a9022fc 100644 --- a/GUI/host/textthread.cc +++ b/GUI/host/textthread.cc @@ -7,7 +7,7 @@ #include "const.h" #include -TextThread::TextThread(ThreadParam tp, DWORD status) : handle(ThreadCounter++), name(Host::GetHookName(tp.pid, tp.hook)), tp(tp), status(status) {} +TextThread::TextThread(ThreadParam tp, DWORD status) : handle(threadCounter++), name(Host::GetHookName(tp.pid, tp.hook)), tp(tp), status(status) {} TextThread::~TextThread() { @@ -27,7 +27,7 @@ void TextThread::Flush() std::wstring sentence; { LOCK(ttMutex); - if (buffer.size() < MaxBufferSize && (GetTickCount() - timestamp < FlushDelay || buffer.size() < 2)) return; + if (buffer.size() < maxBufferSize && GetTickCount() - timestamp < flushDelay) return; sentence = buffer; buffer.clear(); } diff --git a/GUI/host/textthread.h b/GUI/host/textthread.h index 17dca6d..02ee810 100644 --- a/GUI/host/textthread.h +++ b/GUI/host/textthread.h @@ -15,9 +15,9 @@ public: inline static OutputCallback Output; inline static std::wstring filter = L""; - inline static int FlushDelay = 250; // flush every 250ms by default - inline static int MaxBufferSize = 200; - inline static int ThreadCounter = 0; + inline static int flushDelay = 250; // flush every 250ms by default + inline static int maxBufferSize = 200; + inline static int threadCounter = 0; TextThread(ThreadParam tp, DWORD status); ~TextThread(); diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 407ed44..7a1311e 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -13,8 +13,8 @@ MainWindow::MainWindow(QWidget *parent) : ui->setupUi(this); if (settings.contains("Window")) this->setGeometry(settings.value("Window").toRect()); // TODO: add GUI for changing these - if (settings.contains("Flush_Delay")) TextThread::FlushDelay = settings.value("Flush_Delay").toInt(); - if (settings.contains("Max_Buffer_Size")) TextThread::MaxBufferSize = settings.value("Max_Buffer_Size").toInt(); + if (settings.contains("Flush_Delay")) TextThread::flushDelay = settings.value("Flush_Delay").toInt(); + if (settings.contains("Max_Buffer_Size")) TextThread::maxBufferSize = settings.value("Max_Buffer_Size").toInt(); processCombo = findChild("processCombo"); ttCombo = findChild("ttCombo"); @@ -41,8 +41,8 @@ MainWindow::MainWindow(QWidget *parent) : MainWindow::~MainWindow() { settings.setValue("Window", this->geometry()); - settings.setValue("Flush_Delay", TextThread::FlushDelay); - settings.setValue("Max_Buffer_Size", TextThread::MaxBufferSize); + settings.setValue("Flush_Delay", TextThread::flushDelay); + settings.setValue("Max_Buffer_Size", TextThread::maxBufferSize); settings.sync(); Host::Close(); delete ui;