From 2ffc6efa2716f45edc637061edc47f4db09077e4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 18:09:45 +0200 Subject: [PATCH 1/4] CChannelList: ensure disconnect signal/slot on delete of channellist ojects Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/66c109f8f987c14e0ad1547a54d5b7c9aa7cded3 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) --- src/gui/channellist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.h b/src/gui/channellist.h index edde1bbda..40d2c74d1 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -67,7 +67,7 @@ enum { class CFrameBuffer; class CBouquet; -class CChannelList : public CListHelpers +class CChannelList : public CListHelpers, public sigc::trackable { private: enum state_ From 1a50a2022eb634d54e6a4748e2d7c484295c92e4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 16:17:01 +0200 Subject: [PATCH 2/4] SNeutrinoSettings: add missing enums for channellist additional modes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5778d9295ab3491a4049fe536d33829c7531e913 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) --- src/system/settings.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/system/settings.h b/src/system/settings.h index fa2ec6e94..08b9dc3d1 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -588,6 +588,13 @@ struct SNeutrinoSettings int window_height; int eventlist_additional; int eventlist_epgplus; + + enum CHANNELLIST_ADDITIONAL_MODES + { + CHANNELLIST_ADDITIONAL_MODE_OFF = 0, + CHANNELLIST_ADDITIONAL_MODE_EPG = 1, + CHANNELLIST_ADDITIONAL_MODE_MINITV = 2 + }; int channellist_additional; int channellist_epgtext_align_right; int channellist_foot; From 5bb1f36a420e271dc6c1faddfaa45f634a4b8084 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 16:17:53 +0200 Subject: [PATCH 3/4] CChannelList: use enums for additional modes Readability Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/761bac8ca11f79066745025185d0c2f212406799 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) --- src/gui/channellist.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 841d52990..20ffa551c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -119,7 +119,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); fdescrheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight(); - previous_channellist_additional = -1; + previous_channellist_additional = g_settings.channellist_additional; eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT; dline = NULL; @@ -484,7 +484,7 @@ void CChannelList::calcSize() fheight = 1; /* avoid div-by-zero crash on invalid font */ footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; - minitv_is_active = ( (g_settings.channellist_additional == 2) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); + minitv_is_active = ( (g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width full_width = minitv_is_active ? (frameBuffer->getScreenWidth()-2*DETAILSLINE_WIDTH) : frameBuffer->getScreenWidthRel(); @@ -947,7 +947,7 @@ int CChannelList::show() void CChannelList::hide() { paint_events(-2); // cancel paint_events thread - if ((g_settings.channellist_additional == 2) || (previous_channellist_additional == 2)) // with miniTV + if ((g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) || (previous_channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV)) // with miniTV { if (cc_minitv){ delete cc_minitv; cc_minitv = NULL; From 56ae8eb9b5164b7ced6291a240f0523b03767946 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 7 May 2017 16:37:16 +0200 Subject: [PATCH 4/4] CChannelList: change scope of bool unlocked Scope of the variable 'unlocked' can be reduced. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c8f6888d8f9eb968009f92a0124cc44487a1e3b3 Author: Thilo Graf Date: 2017-05-07 (Sun, 07 May 2017) --- src/gui/channellist.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 20ffa551c..4a3735f5b 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -298,7 +298,7 @@ int CChannelList::doChannelMenu(void) int shortcut = 0; static int old_selected = 0; char cnt[5]; - bool unlocked = true; + int ret = 0; if(g_settings.minimode) @@ -360,7 +360,8 @@ int CChannelList::doChannelMenu(void) CBouquetList *blist = tvmode ? TVfavList : RADIOfavList; bool fav_found = true; switch(select) { - case 0: // edit mode + case 0: {// edit mode + bool unlocked = true; if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED) { int pl_z = g_settings.parentallock_zaptime * 60; if (g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT] == CPersonalizeGui::PERSONALIZE_MODE_PIN) { @@ -385,7 +386,7 @@ int CChannelList::doChannelMenu(void) editMode(true); ret = -1; break; - case 1: // add to + }case 1: // add to if (!addChannelToBouquet()) return -1; ret = 1;