diff --git a/src/Icons/oxygen/office-chart-bar.png b/src/Icons/oxygen/office-chart-bar.png deleted file mode 100644 index dd8ae4e42..000000000 Binary files a/src/Icons/oxygen/office-chart-bar.png and /dev/null differ diff --git a/src/Icons/oxygen/view-statistics.png b/src/Icons/oxygen/view-statistics.png new file mode 100644 index 000000000..9bcb3df78 Binary files /dev/null and b/src/Icons/oxygen/view-statistics.png differ diff --git a/src/icons.qrc b/src/icons.qrc index 23f9b7867..5a138af3b 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -294,7 +294,6 @@ Icons/oxygen/network-server.png Icons/oxygen/network-wired.png Icons/oxygen/object-locked.png - Icons/oxygen/office-chart-bar.png Icons/oxygen/preferences-desktop.png Icons/oxygen/preferences-other.png Icons/oxygen/preferences-system-network.png @@ -315,6 +314,7 @@ Icons/oxygen/view-filter.png Icons/oxygen/view-preview.png Icons/oxygen/view-refresh.png + Icons/oxygen/view-statistics.png Icons/oxygen/wallet-open.png Icons/oxygen/webui.png Icons/skin/arrow-right.gif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e7f24264a..54c3f475b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -127,7 +127,7 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa actionSet_global_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/download.png"))); actionCreate_torrent->setIcon(IconProvider::instance()->getIcon("document-edit")); actionAbout->setIcon(IconProvider::instance()->getIcon("help-about")); - actionStatistics->setIcon(IconProvider::instance()->getIcon("office-chart-bar")); + actionStatistics->setIcon(IconProvider::instance()->getIcon("view-statistics")); actionBugReport->setIcon(IconProvider::instance()->getIcon("tools-report-bug")); actionDecreasePriority->setIcon(IconProvider::instance()->getIcon("go-down")); actionDelete->setIcon(IconProvider::instance()->getIcon("list-remove")); diff --git a/src/qtlibtorrent/torrentspeedmonitor.cpp b/src/qtlibtorrent/torrentspeedmonitor.cpp index 571671503..042e2a35a 100644 --- a/src/qtlibtorrent/torrentspeedmonitor.cpp +++ b/src/qtlibtorrent/torrentspeedmonitor.cpp @@ -159,12 +159,12 @@ qlonglong TorrentSpeedMonitor::getETA(const QString &hash) const quint64 TorrentSpeedMonitor::getAlltimeDL() const { QMutexLocker l(&m_mutex); - return alltimeDL; + return alltimeDL + sessionDL; } quint64 TorrentSpeedMonitor::getAlltimeUL() const { QMutexLocker l(&m_mutex); - return alltimeUL; + return alltimeUL + sessionUL; } void TorrentSpeedMonitor::getSamples() @@ -184,18 +184,19 @@ void TorrentSpeedMonitor::getSamples() int up = st.upload_payload_rate; int down = st.download_payload_rate; m_samples[misc::toQString(it->info_hash())].addSample(down, up); - alltimeDL += down; - alltimeUL += up; } } catch(invalid_handle&) {} } + libtorrent::session_status ss = m_session->getSessionStatus(); + sessionDL = ss.total_download; + sessionUL = ss.total_upload; } void TorrentSpeedMonitor::saveStats() const { QIniSettings s; QVariantHash v; - v.insert("AlltimeDL", alltimeDL); - v.insert("AlltimeUL", alltimeUL); + v.insert("AlltimeDL", alltimeDL + sessionDL); + v.insert("AlltimeUL", alltimeUL + sessionUL); s.setValue("Stats/AllStats", v); } @@ -204,4 +205,5 @@ void TorrentSpeedMonitor::loadStats() { QVariantHash v(s.value("Stats/AllStats", QVariantHash()).toHash()); alltimeDL = v["AlltimeDL"].toULongLong(); alltimeUL = v["AlltimeUL"].toULongLong(); + sessionDL = sessionUL = 0; } diff --git a/src/qtlibtorrent/torrentspeedmonitor.h b/src/qtlibtorrent/torrentspeedmonitor.h index 3a310a719..134d18e88 100644 --- a/src/qtlibtorrent/torrentspeedmonitor.h +++ b/src/qtlibtorrent/torrentspeedmonitor.h @@ -73,6 +73,8 @@ private: // Will overflow at 15.9 EiB quint64 alltimeUL; quint64 alltimeDL; + quint64 sessionUL; + quint64 sessionDL; }; #endif // TORRENTSPEEDMONITOR_H