From: Andreas Monzner Date: Sun, 13 Nov 2005 08:57:45 +0000 (+0000) Subject: dont open epglist when no epg is avail X-Git-Tag: 2.6.0~5270 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/3d5ee66a7e80c61e431e74e821242e144e88f008?hp=8abe6bd8b06640ce47fc26f2786801106536c96e dont open epglist when no epg is avail --- diff --git a/lib/components/listboxepg.cpp b/lib/components/listboxepg.cpp index d088006b..0d5c5412 100644 --- a/lib/components/listboxepg.cpp +++ b/lib/components/listboxepg.cpp @@ -4,8 +4,8 @@ void eListboxEPGContent::setRoot(const eServiceReference &root) { - eEPGCache *epg=NULL; - if ( !eEPGCache::getInstance(epg) ) + eEPGCache *epg=eEPGCache::getInstance(); + if ( epg ) { m_list.clear(); m_root = root; diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 7b94a1a7..c1f294a6 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -747,14 +747,6 @@ void eEPGCache::save() #endif } -RESULT eEPGCache::getInstance(eEPGCache *&ptr) -{ - ptr = instance; - if (!ptr) - return -1; - return 0; -} - eEPGCache::channel_data::channel_data(eEPGCache *ml) :cache(ml) ,abortTimer(ml), zapTimer(ml) diff --git a/lib/dvb/epgcache.h b/lib/dvb/epgcache.h index 5643fa43..aa0410b3 100644 --- a/lib/dvb/epgcache.h +++ b/lib/dvb/epgcache.h @@ -223,7 +223,7 @@ private: timeMap::iterator m_timemap_cursor, m_timemap_end; #endif // SWIG public: - static RESULT getInstance(eEPGCache *&ptr); + static eEPGCache *getInstance() { return instance; } eEPGCache(); ~eEPGCache(); @@ -257,7 +257,7 @@ public: // eServiceEvent are parsed epg events.. it's safe to use them after cache unlock // for use from python ( members: m_start_time, m_duration, m_short_description, m_extended_description ) RESULT lookupEvent(const eServiceReference &service, int event_id, ePtr &); - RESULT lookupEvent(const eServiceReference &service, time_t , ePtr &); + RESULT lookupEvent(const eServiceReference &service, time_t, ePtr &); RESULT getNextTimeEntry(ePtr &); }; diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index b30190e4..c31b7949 100644 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -3,7 +3,7 @@ from Components.Button import Button from Components.ServiceList import ServiceList from Components.ActionMap import ActionMap from EpgSelection import EPGSelection -from enigma import eServiceReference +from enigma import eServiceReference, eEPGCache, eEPGCachePtr from Screens.FixedMenu import FixedMenu @@ -87,7 +87,12 @@ class ChannelSelection(Screen): self["actions"].csel = self def showEPGList(self): - self.session.open(EPGSelection, self["list"].getCurrent()) + ref=self["list"].getCurrent() + ptr=eEPGCache.getInstance() + if ptr.startTimeQuery(ref) != -1: + self.session.open(EPGSelection, ref) + else: + print 'no epg for service', ref.toString() # marked edit mode def startMarkedEdit(self): diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 62639c04..78a47ddd 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -224,7 +224,12 @@ class InfoBar(Screen): self.muteDialog.instance.hide() def showEPGList(self): - self.session.open(EPGSelection, self.session.nav.getCurrentlyPlayingServiceReference()) + ref=self.session.nav.getCurrentlyPlayingServiceReference() + ptr=eEPGCache.getInstance() + if ptr.startTimeQuery(ref) != -1: + self.session.open(EPGSelection, ref) + else: + print 'no epg for service', ref.toString() def quit(self): self.session.open(Standby)