File indexing completed on 2024-12-08 10:25:49

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "loadrecenthistorymanager.h"
0008 #include "ruqola_debug.h"
0009 
0010 LoadRecentHistoryManager::LoadRecentHistoryManager() = default;
0011 
0012 LoadRecentHistoryManager::~LoadRecentHistoryManager() = default;
0013 
0014 qint64 LoadRecentHistoryManager::lastLoadingTimeStamp() const
0015 {
0016     return mLastLoadingTimeStamp;
0017 }
0018 
0019 qint64 LoadRecentHistoryManager::generateNewStartTimeStamp(qint64 lastTimeStamp)
0020 {
0021     const qint64 newTimeStamp = qMin(mLastLoadingTimeStamp, lastTimeStamp) - (86400 * 3 * 1000);
0022     mLastLoadingTimeStamp = newTimeStamp;
0023     qCDebug(RUQOLA_LOG) << "newTimeStamp " << QDateTime::fromMSecsSinceEpoch(newTimeStamp);
0024     return newTimeStamp;
0025 }