mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-18 20:50:09 +08:00
fix looping functions
This commit is contained in:
parent
3f3b268916
commit
d2634d1321
@ -43,8 +43,6 @@ namespace Stats
|
||||
|
||||
void ForceUpdate();
|
||||
|
||||
void stopLoop();
|
||||
|
||||
void setSort(ConnectionSort newSort);
|
||||
|
||||
private:
|
||||
@ -52,8 +50,6 @@ namespace Stats
|
||||
|
||||
QMutex mu;
|
||||
|
||||
bool stop = false;
|
||||
|
||||
std::shared_ptr<QSet<QString>> state;
|
||||
|
||||
ConnectionSort sort = Default;
|
||||
|
||||
@ -25,7 +25,7 @@ namespace Stats
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (stop) return;
|
||||
if (Configs::dataStore->prepare_exit) return;
|
||||
QThread::msleep(1000);
|
||||
|
||||
if (suspend || !Configs::dataStore->enable_stats) continue;
|
||||
@ -137,11 +137,6 @@ namespace Stats
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionLister::stopLoop()
|
||||
{
|
||||
stop = true;
|
||||
}
|
||||
|
||||
void ConnectionLister::setSort(const ConnectionSort newSort)
|
||||
{
|
||||
if (newSort == ByTraffic)
|
||||
|
||||
@ -67,6 +67,7 @@ namespace Stats {
|
||||
void TrafficLooper::Loop() {
|
||||
elapsedTimer.start();
|
||||
while (true) {
|
||||
if (Configs::dataStore->prepare_exit) return;
|
||||
QThread::msleep(1000); // refresh every one second
|
||||
|
||||
if (Configs::dataStore->disable_traffic_stats) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user