From 4e08f034f8ed7e208b20c26e6a1bb11706a25f3e Mon Sep 17 00:00:00 2001 From: acetone Date: Sat, 19 Nov 2022 22:48:22 +0300 Subject: [PATCH] hf 10 --- src/statistics.cpp | 9 ++++++--- src/webpage.cpp | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/statistics.cpp b/src/statistics.cpp index c2687cb..6d10a61 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -83,11 +83,14 @@ void Statistics::addToDestinationsList(const QString &dest) { static QMutex mutex; mutex.lock(); - if (lastDestinations().size() >= g::c::LAST_AND_TOP_LIST_SIZE) + if (not lastDestinations().contains(dest)) { - m_lastDestinations.pop_back(); + if (lastDestinations().size() >= g::c::LAST_AND_TOP_LIST_SIZE) + { + m_lastDestinations.pop_back(); + } + m_lastDestinations.push_front(dest); } - m_lastDestinations.push_front(dest); mutex.unlock(); DBManager db; diff --git a/src/webpage.cpp b/src/webpage.cpp index f2c0161..a8d8f13 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -334,5 +334,6 @@ QPair WebPage::bytesToHumanReadableString(quint64 bytes) result.second = "PiB"; } + qDebug().noquote() << "Bytes to human-readable:" << bytes << "->" << result.first << result.second; return result; }