From b391554b16bef3f14545489b6e06c40f7d4a87e2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 25 May 2021 22:52:17 +0200 Subject: [PATCH] epgview: introduce ResetMDb() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3e981cc3e6508e582bb6d2b6b12284fc40c0bde Author: vanhofen Date: 2021-05-25 (Tue, 25 May 2021) Origin message was: ------------------ - epgview: introduce ResetMDb() --- src/gui/epgview.cpp | 32 +++++++++++++------------------- src/gui/epgview.h | 1 + 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 59b358c25..c8972f812 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -133,9 +133,8 @@ CEpgData::CEpgData() imdb = CIMDB::getInstance(); - imdb_active = false; tmdb = CTMDB::getInstance(); - tmdb_active = false; + ResetMDb(); movie_filename.clear(); } @@ -731,10 +730,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start startzeit=*a_startzeit; id=a_id; - imdb_active = false; - imdb_stars = 0; - tmdb_active = false; - tmdb_stars = 0; + ResetMDb(); t_channel_id epg_id = channel_id; CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); @@ -1271,10 +1267,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } case CRCInput::RC_blue: { - imdb_active = false; - imdb_stars = 0; - tmdb_active = false; - tmdb_stars = 0; + ResetMDb(); if(!followlist.empty() && !call_fromfollowlist){ hide(); @@ -1334,10 +1327,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; } case CRCInput::RC_help: - imdb_active = false; - imdb_stars = 0; - tmdb_active = false; - tmdb_stars = 0; + ResetMDb(); bigFonts = bigFonts ? false : true; ResetModules(); @@ -1458,13 +1448,9 @@ void CEpgData::hide() frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); showTimerEventBar (false); - // imdb - imdb_active = false; imdb->cleanup(); - - // tmdb - tmdb_active = false; tmdb->cleanup(); + ResetMDb(); } void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear ) @@ -1713,6 +1699,14 @@ void CEpgData::ResetModules() } } +void CEpgData::ResetMDb() +{ + imdb_active = false; + imdb_stars = 0; + tmdb_active = false; + tmdb_stars = 0; +} + // -- EPG Data Viewer Menu Handler Class // -- to be used for calls from Menu diff --git a/src/gui/epgview.h b/src/gui/epgview.h index d2dfe1f9b..fe9e93859 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -102,6 +102,7 @@ class CEpgData void showTimerEventBar(bool show, bool adzap = false, bool mp_info = false); void showProgressBar(); bool isCurrentEPG(const t_channel_id channel_id); + void ResetMDb(); std::string epg_title; std::string movie_filename;