From: Andreas Monzner Date: Wed, 3 Jan 2007 11:12:13 +0000 (+0000) Subject: remove ugly HACK X-Git-Tag: 2.6.0~2527 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/8a951b87cc4f6d4db0f1c3c9113a4c0943971ef2?ds=sidebyside remove ugly HACK send evEnd in correct order (this assumes that no one need the currentService after evEnd is dispatched or in the evEnd callback --- diff --git a/Navigation.py b/Navigation.py index ece89227..06d47ac4 100644 --- a/Navigation.py +++ b/Navigation.py @@ -28,12 +28,10 @@ class Navigation: self.record_event = [ ] self.currentlyPlayingServiceReference = None self.currentlyPlayingService = None - self.state = 0 self.RecordTimer = RecordTimer.RecordTimer() self.SleepTimer = SleepTimer.SleepTimer() def dispatchEvent(self, i): - self.state = i != 1 for x in self.event: x(i) @@ -91,11 +89,9 @@ class Navigation: return self.pnav and self.pnav.getRecordings() def getCurrentService(self): - if self.state: - if not self.currentlyPlayingService: - self.currentlyPlayingService = self.pnav and self.pnav.getCurrentService() - return self.currentlyPlayingService - return None + if not self.currentlyPlayingService: + self.currentlyPlayingService = self.pnav and self.pnav.getCurrentService() + return self.currentlyPlayingService def stopService(self): print "stopService" diff --git a/lib/nav/core.cpp b/lib/nav/core.cpp index 45b4aa6f..0b690b81 100644 --- a/lib/nav/core.cpp +++ b/lib/nav/core.cpp @@ -59,13 +59,14 @@ RESULT eNavigation::stopService(void) /* check if there is a running service... */ if (!m_runningService) return 1; - /* send stop event */ - m_event(iPlayableService::evEnd); ePtr tmp = m_runningService; m_runningService=0; tmp->stop(); + /* send stop event */ + m_event(iPlayableService::evEnd); + /* kill service. */ m_service_event_conn = 0; return 0;