This commit is contained in:
acetone
2022-11-19 22:48:22 +03:00
parent d4f73e231d
commit 4e08f034f8
2 changed files with 7 additions and 3 deletions
+6 -3
View File
@@ -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;