Skip to content

Commit

Permalink
[New Feature] add clear Traffic option
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWanderingCoel committed May 25, 2020
1 parent 5bf2d00 commit 7407b80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void Connection::start()
if (conf->getSystemProxySettings() != "advance")
http->httpListen(QHostAddress(localAddr),
conf->getHttpPort(),
localAddr,
"127.0.0.1",
conf->getSocks5Port());

//start tun2socks if settings is configured to do so
Expand Down
9 changes: 9 additions & 0 deletions src/connectionitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ void ConnectionItem::testLatency()
con->latencyTest();
}

void ConnectionItem::clearTraffic()
{
TQProfile p;
p = con->getProfile();
p.currentUsage = 0;
p.totalUsage = 0;
con->setProfile(p);
}

Connection* ConnectionItem::getConnection()
{
return con;
Expand Down
1 change: 1 addition & 0 deletions src/connectionitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ConnectionItem : public QObject

Connection* getConnection();
void testLatency();
void clearTraffic();

signals:
void message(const QString&);
Expand Down

0 comments on commit 7407b80

Please sign in to comment.