diff --git a/mythtv/libs/libmythbase/hardwareprofile.cpp b/mythtv/libs/libmythbase/hardwareprofile.cpp index d545830b9e8..22d2ac256f8 100644 --- a/mythtv/libs/libmythbase/hardwareprofile.cpp +++ b/mythtv/libs/libmythbase/hardwareprofile.cpp @@ -288,10 +288,12 @@ QString HardwareProfile::GetHardwareProfile() const bool HardwareProfileTask::DoCheckRun(QDateTime now) { - if (GetLastRun().secsTo(now) > 2592000 && // 60*60*24*30 - (gCoreContext->GetNumSetting("HardwareProfileEnabled", 0) == 1)) - return true; - return false; + if (gCoreContext->GetNumSetting("HardwareProfileEnabled", 0) == 0) + // global disable, we don't want to run + return false; + + // leave it up to the standard periodic calculation, 30 +-1 days + return PeriodicHouseKeeperTask::DoCheckRun(now); } bool HardwareProfileTask::DoRun(void) diff --git a/mythtv/libs/libmythbase/hardwareprofile.h b/mythtv/libs/libmythbase/hardwareprofile.h index a45cf3aff22..a4cf4bceefc 100644 --- a/mythtv/libs/libmythbase/hardwareprofile.h +++ b/mythtv/libs/libmythbase/hardwareprofile.h @@ -49,10 +49,13 @@ class MBASE_PUBLIC HardwareProfile : public QObject QString m_hardwareProfile; }; -class MBASE_PUBLIC HardwareProfileTask : public HouseKeeperTask +class MBASE_PUBLIC HardwareProfileTask : public PeriodicHouseKeeperTask { public: - HardwareProfileTask(void) : HouseKeeperTask("HardwareProfiler", + HardwareProfileTask(void) : PeriodicHouseKeeperTask("HardwareProfiler", + 2592000, // 30 days in seconds + 0.96667, // up to one day early + 1.03333, // up to one day late kHKLocal, kHKRunOnStartup) {} virtual bool DoCheckRun(QDateTime now); virtual bool DoRun(void);