merge
This commit is contained in:
2018-10-08 22:21:11 +08:00
3 changed files with 11 additions and 3 deletions
+3 -3
View File
@@ -408,7 +408,7 @@ void MainTray::handleState(NetController::State state)
void MainTray::handleInfo(QString byte, QString sec, QString balance, QString ip)
{
QString mbString = QString::number(byte.toDouble() / 1048576.0, 'f', 2);
QString mbString = QString::number(byte.toDouble() / 1000000.0, 'f', 2);
QString gbString = QString::number(byte.toDouble() / 1000000000.0, 'f', 2);
QString leftoverString = QString::number(totalTraffic - byte.toDouble() / 1000000000.0, 'f', 2);
double totalSec = sec.toDouble();
@@ -422,7 +422,7 @@ void MainTray::handleInfo(QString byte, QString sec, QString balance, QString ip
if (!hasWarned && totalTraffic > 0)
{
hasWarned = true;
if (byte.toDouble() / 1048576.0 > totalTraffic * 1024)
if (byte.toDouble() / 1000000.0 > totalTraffic * 1024)
{ //流量已超
trafficstate = Over;
if (!muteAction->isChecked())
@@ -430,7 +430,7 @@ void MainTray::handleInfo(QString byte, QString sec, QString balance, QString ip
showMessage(tr("流量警告"), tr("本月流量已超"), QSystemTrayIcon::Warning);
});
}
else if (byte.toDouble() / 1048576.0 + 5000 > totalTraffic * 1024)
else if (byte.toDouble() / 1000000.0 + 5000 > totalTraffic * 1024)
{ //流量将超
trafficstate = Nearly;
if (!muteAction->isChecked())
+6
View File
@@ -11,7 +11,13 @@ NetController::NetController(QByteArray id, QByteArray passwd, QObject *parent)
desktopRequest.setRawHeader("Cache-Control", "max-age=0");
desktopRequest.setRawHeader("Origin", "http://ipgw.neu.edu.cn");
desktopRequest.setRawHeader("Upgrade-Insecure-Requests", "1");
#ifdef Q_OS_LINUX
desktopRequest.setRawHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36");
#endif
#ifdef Q_OS_WIN32
desktopRequest.setRawHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36");
#endif
desktopRequest.setRawHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
desktopRequest.setRawHeader("Referer", "http://ipgw.neu.edu.cn/srun_portal_pc.php?ac_id=1&");
desktopRequest.setRawHeader("Accept-Encoding", "gzip, deflate");
+2
View File
@@ -0,0 +1,2 @@
[Paths]
Plugins = /usr/lib/qt/plugins/