mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:35:08 +00:00
DB: Fix active period handling.
This commit is contained in:
parent
ee02e1c50c
commit
a6314be459
@ -118,9 +118,6 @@ void DatabaseManager::initializeActivePeriod()
|
||||
{
|
||||
m_isActivePeriodSet = false;
|
||||
|
||||
activePeriodFromHour = activePeriodFromMinute
|
||||
= activePeriodToHour = activePeriodToMinute = 0;
|
||||
|
||||
if (!m_conf) return;
|
||||
|
||||
DateUtil::parseTime(m_conf->activePeriodFrom(),
|
||||
@ -303,11 +300,10 @@ void DatabaseManager::logStatTraf(quint16 procCount, const quint32 *procTrafByte
|
||||
m_isActivePeriod = true;
|
||||
|
||||
if (m_conf->activePeriodEnabled()) {
|
||||
const int hour = trafHour - trafDay;
|
||||
const int minute = int(unixTime - DateUtil::toUnixTime(trafHour)) / 60;
|
||||
const QTime now = QTime::currentTime();
|
||||
|
||||
m_isActivePeriod = FortCommon::isTimeInPeriod(
|
||||
hour, minute,
|
||||
quint8(now.hour()), quint8(now.minute()),
|
||||
activePeriodFromHour, activePeriodFromMinute,
|
||||
activePeriodToHour, activePeriodToMinute);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user