From cfa5aa641472f97a3898e228093e80798284f040 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Jan 2018 10:49:50 +0100 Subject: [PATCH] infoicons: avoid extern CInfoIcons; use getInstance() instead of this Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5a34b06137a973ba7c9ca7b62187d493e9f91b8c Author: vanhofen Date: 2018-01-03 (Wed, 03 Jan 2018) Origin message was: ------------------ - infoicons: avoid extern CInfoIcons; use getInstance() instead of this ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoicons_setup.cpp | 3 +-- src/gui/infoviewer.cpp | 13 ++++++------- src/gui/mediaplayer.cpp | 5 ++--- src/gui/pictureviewer.cpp | 5 ++--- src/gui/screensaver.cpp | 9 ++++----- src/gui/timeosd.cpp | 9 ++++----- src/gui/upnpbrowser.cpp | 5 ++--- src/gui/user_menue.cpp | 5 ++--- src/nhttpd/tuxboxapi/controlapi.cpp | 5 ++--- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 1 - 10 files changed, 25 insertions(+), 35 deletions(-) diff --git a/src/gui/infoicons_setup.cpp b/src/gui/infoicons_setup.cpp index 317c0629c..c2ed8d190 100644 --- a/src/gui/infoicons_setup.cpp +++ b/src/gui/infoicons_setup.cpp @@ -38,7 +38,6 @@ #include #include -extern CInfoIcons *InfoIcons; /* neutrino.cpp */ typedef struct menu_data_t { @@ -106,7 +105,7 @@ int CInfoIconsSetup::exec(CMenuTarget* parent, const std::string &actionKey) res = menu_return::RETURN_EXIT; } else if(actionKey.substr(0,18) == "infoicons_switch") { - InfoIcons->switchInfoIconsOnOff(); + CInfoIcons::getInstance()->switchInfoIconsOnOff(); res = menu_return::RETURN_EXIT_ALL; } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6b1b422a1..cfbb43f00 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -83,7 +83,6 @@ //NI InfoIcons #include "gui/infoicons.h" -extern CInfoIcons *InfoIcons; /* neutrino.cpp */ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CBouquetList * bouquetList; /* neutrino.cpp */ @@ -794,7 +793,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap //NI InfoIcons if (!g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_INFOVIEWER) - InfoIcons->paintIcons(true); + CInfoIcons::getInstance()->paintIcons(true); if (showButtonBar) { infoViewerBB->paintshowButtonBar(noTimer); @@ -1384,9 +1383,9 @@ void CInfoViewer::killRadiotext() CInfoClock::getInstance()->enableInfoClock(true); //NI InfoIcons if (!g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_INFOVIEWER) - InfoIcons->paintIcons(true); + CInfoIcons::getInstance()->paintIcons(true); else - InfoIcons->enableInfoIcons(true); + CInfoIcons::getInstance()->enableInfoIcons(true); } void CInfoViewer::showRadiotext() @@ -1409,9 +1408,9 @@ void CInfoViewer::showRadiotext() CInfoClock::getInstance()->enableInfoClock(false); //NI InfoIcons if (!g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_INFOVIEWER) - InfoIcons->hideIcons(); + CInfoIcons::getInstance()->hideIcons(); else - InfoIcons->enableInfoIcons(false); + CInfoIcons::getInstance()->enableInfoIcons(false); int rt_font = SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO; int item_h = g_Font[rt_font]->getHeight(); @@ -2163,7 +2162,7 @@ void CInfoViewer::killTitle() //NI InfoIcons if (!g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_INFOVIEWER) - InfoIcons->hideIcons(); + CInfoIcons::getInstance()->hideIcons(); } showButtonBar = false; CInfoClock::getInstance()->enableInfoClock(); diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 73fe9ae07..efbd0a95a 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -57,7 +57,6 @@ extern cVideo * videoDecoder; //NI InfoIcons #include -extern CInfoIcons *InfoIcons; CMediaPlayerMenu::CMediaPlayerMenu() { @@ -108,7 +107,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) { audiomute->enableMuteIcon(false); CInfoClock::getInstance()->enableInfoClock(false); - InfoIcons->enableInfoIcons(false); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons int mode = CNeutrinoApp::getInstance()->getMode(); if( mode == NeutrinoModes::mode_radio ) CFrameBuffer::getInstance()->stopFrame(); @@ -117,7 +116,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) CFrameBuffer::getInstance()->showFrame("radiomode.jpg"); audiomute->enableMuteIcon(true); CInfoClock::getInstance()->enableInfoClock(true); - InfoIcons->enableInfoIcons(true); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(true); //NI InfoIcons return res; } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index ab7ad2c18..c4a99bc2f 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -82,7 +82,6 @@ extern cVideo * videoDecoder; //NI InfoIcons #include -extern CInfoIcons *InfoIcons; //------------------------------------------------------------------------ bool comparePictureByDate (const CPicture& a, const CPicture& b) @@ -264,7 +263,7 @@ int CPictureViewerGui::show() CAudioMute::getInstance()->enableMuteIcon(false); CInfoClock::getInstance()->enableInfoClock(false); - InfoIcons->enableInfoIcons(false); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons while (loop) { @@ -663,7 +662,7 @@ int CPictureViewerGui::show() CAudioMute::getInstance()->enableMuteIcon(true); CInfoClock::getInstance()->enableInfoClock(true); - InfoIcons->enableInfoIcons(true); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(true); //NI InfoIcons return(res); } diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index d16bbc031..cccc2165d 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -49,7 +49,6 @@ extern cVideo * videoDecoder; //NI InfoIcons #include -extern CInfoIcons *InfoIcons; using namespace std; @@ -60,7 +59,7 @@ CScreenSaver::CScreenSaver() m_viewer = new CPictureViewer(); index = 0; status_mute = CAudioMute::getInstance()->getStatus(); - status_icons = InfoIcons->getStatus(); //NI + status_icons = CInfoIcons::getInstance()->getStatus(); //NI scr_clock = NULL; clr.i_color = COL_DARK_GRAY; pip_channel_id = 0; @@ -99,8 +98,8 @@ void CScreenSaver::Start() CInfoClock::getInstance()->disableInfoClock(); //NI - status_icons = InfoIcons->getStatus(); - InfoIcons->enableInfoIcons(false); + status_icons = CInfoIcons::getInstance()->getStatus(); + CInfoIcons::getInstance()->enableInfoIcons(false); #ifdef ENABLE_PIP pip_channel_id = CZapit::getInstance()->GetPipChannelID(); @@ -152,7 +151,7 @@ void CScreenSaver::Stop() #endif m_frameBuffer->paintBackground(); //clear entire screen - InfoIcons->enableInfoIcons(status_icons); //NI + CInfoIcons::getInstance()->enableInfoIcons(status_icons); //NI CAudioMute::getInstance()->enableMuteIcon(status_mute); if (!OnAfterStop.empty()){ diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index 75d1bd5b6..59ca8e831 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -38,7 +38,6 @@ //NI InfoIcons #include -extern CInfoIcons *InfoIcons; CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON) @@ -158,21 +157,21 @@ void CTimeOSD::switchMode(int position, int duration) switch (m_mode) { case MODE_ASC: case MODE_TMP: - InfoIcons->enableInfoIcons(false); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons m_mode = MODE_DESC; CComponents::kill(); break; case MODE_DESC: - InfoIcons->enableInfoIcons(false); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons m_mode = MODE_BAR; CComponents::kill(); break; case MODE_BAR: - InfoIcons->enableInfoIcons(true); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(true); //NI InfoIcons KillAndResetTimescale(); return; default: - InfoIcons->enableInfoIcons(false); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons m_mode = MODE_ASC; } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index ea6afebec..56efe297d 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -60,7 +60,6 @@ extern CPictureViewer * g_PicViewer; //NI InfoIcons #include -extern CInfoIcons *InfoIcons; const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN}; const struct button_label BrowseButtons[] = @@ -521,7 +520,7 @@ void CUpnpBrowserGui::selectDevice() return; CAudioMute::getInstance()->enableMuteIcon(false); - InfoIcons->enableInfoIcons(false); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons while (loop) { @@ -593,7 +592,7 @@ void CUpnpBrowserGui::selectDevice() } } CAudioMute::getInstance()->enableMuteIcon(true); - InfoIcons->enableInfoIcons(true); //NI InfoIcons + CInfoIcons::getInstance()->enableInfoIcons(true); //NI InfoIcons } void CUpnpBrowserGui::playnext(void) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 50efb0196..bf0915583 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -99,7 +99,6 @@ extern CCAMMenuHandler * g_CamHandler; #include #include -extern CInfoIcons *InfoIcons; CUserMenu::CUserMenu() { @@ -571,7 +570,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) } CInfoClock::getInstance()->enableInfoClock(false); - InfoIcons->enableInfoIcons(false); //NI + CInfoIcons::getInstance()->enableInfoIcons(false); //NI // show menu if there are more than 2 items only // otherwise, we start the item directly (must be the last one) if (menu_items > 1 ) @@ -580,7 +579,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) last_menu_item->exec( NULL ); CInfoClock::getInstance()->enableInfoClock(true); - InfoIcons->enableInfoIcons(true); //NI + CInfoIcons::getInstance()->enableInfoIcons(true); //NI CNeutrinoApp::getInstance()->StartSubtitles(); if (button < COL_BUTTONMAX) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index c21e8f295..ffbd8ecf8 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -57,7 +57,6 @@ extern cVideo * videoDecoder; //NI #include #include "gui/infoicons.h" -extern CInfoIcons *InfoIcons; /* neutrino.cpp */ //NI #include "gui/update.h" @@ -4003,9 +4002,9 @@ void CControlAPI::InfoIconsCGI(CyhookHandler *hh) if (g_settings.mode_icons != remember_mode_icons) { if (remember_mode_icons) - InfoIcons->enableInfoIcons(false); + CInfoIcons::getInstance()->enableInfoIcons(false); else - InfoIcons->enableInfoIcons(true); + CInfoIcons::getInstance()->enableInfoIcons(true); } hh->SendOk(); diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index fb9892485..0f564b90b 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -38,7 +38,6 @@ #include "gui/plugins.h" extern CPlugins *g_Plugins; #include "gui/infoicons.h" -extern CInfoIcons *InfoIcons; /* neutrino.cpp */ #include "gui/netfs_setup.h" extern CBouquetManager *g_bouquetManager;