From 5f8d768468d71154e2bd29b667c6aa8af453fe27 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 4 Jan 2009 12:42:52 +0100 Subject: use shutdown handler to prevent an interrupted search timer update --- searchtimer_thread.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'searchtimer_thread.c') diff --git a/searchtimer_thread.c b/searchtimer_thread.c index eb20218..3e17ade 100644 --- a/searchtimer_thread.c +++ b/searchtimer_thread.c @@ -53,6 +53,7 @@ extern int updateForced; cSearchTimerThread *cSearchTimerThread::m_Instance = NULL; cSearchResults cSearchTimerThread::announceList; +bool cSearchTimerThread::justRunning = false; cSearchTimerThread::cSearchTimerThread(cPluginEpgsearch* thePlugin) : cThread("EPGSearch: searchtimer") @@ -208,6 +209,7 @@ void cSearchTimerThread::Action(void) bool needUpdate = NeedUpdate(); if (now >= nextUpdate || needUpdate) { + justRunning = true; if (Timers.BeingEdited()) { Wait.Wait(1000); @@ -394,7 +396,7 @@ void cSearchTimerThread::Action(void) NoAnnounces.InList(pEvent) || // announcement not wanted anymore or (EPGSearchConfig.noAnnounceWhileReplay && cDevice::PrimaryDevice()->Replaying() && cDevice::PrimaryDevice()->Transferring() && - updateForced != 2) // no announce while replay within automatic updates + !(updateForced & UPDS_WITH_OSD)) // no announce while replay within automatic updates ) { if (Summary) free(Summary); @@ -506,7 +508,7 @@ void cSearchTimerThread::Action(void) bool doMessage = EPGSearchConfig.noConflMsgWhileReplay == 0 || !cDevice::PrimaryDevice()->Replaying() || conflictCheck.nextRelevantConflictDate - now < 2*60*60 || - updateForced == 2; + (updateForced & UPDS_WITH_OSD); if (doMessage && SendMsg(msgfmt, true,7) == kOk) { m_plugin->showConflicts = true; @@ -526,7 +528,7 @@ void cSearchTimerThread::Action(void) if (m_Active) mailNotifier.SendUpdateNotifications(); - if (updateForced == 2 && m_Active) + if ((updateForced & UPDS_WITH_OSD) && m_Active) SendMsg(tr("Search timer update done!")); // reset service call flag @@ -534,6 +536,7 @@ void cSearchTimerThread::Action(void) m_lastUpdate = time(NULL); nextUpdate = long(m_lastUpdate/60)*60 + (EPGSearchConfig.UpdateIntervall * 60); + justRunning = false; } if (m_Active) Wait.Wait(2000); // to avoid high system load if time%30==0 -- cgit v1.2.3