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