diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index 5c6f03105..3d3d056af 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -171,11 +171,7 @@ int CWebTVSetup::Show() for (std::list::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it) { //NI - if ( - (*it).empty() - || ((*it).find(WEBTVDIR) != std::string::npos) - || ((*it).find(WEBTVDIR_VAR) != std::string::npos) - ) + if (webtv_xml_autodir((*it))) continue; m->addItem(new CMenuForwarder(*it, true, NULL, this, "c")); } @@ -263,6 +259,17 @@ void CWebTVSetup::webtv_xml_auto() } +bool CWebTVSetup::webtv_xml_autodir(std::string directory) +{ + if ( + (directory.empty()) + || (directory.find(WEBTVDIR) != std::string::npos) + || (directory.find(WEBTVDIR_VAR) != std::string::npos) + ) + return true; + return false; +} + /* ## CWebTVResolution ############################################# */ CWebTVResolution::CWebTVResolution() diff --git a/src/gui/webtv_setup.h b/src/gui/webtv_setup.h index 771524480..cbe6fae2f 100644 --- a/src/gui/webtv_setup.h +++ b/src/gui/webtv_setup.h @@ -41,6 +41,7 @@ class CWebTVSetup : public CMenuTarget, CChangeObserver //NI int Show(); bool changeNotify(const neutrino_locale_t, void * data); //NI void webtv_xml_auto(); //NI + bool webtv_xml_autodir(std::string directory); }; class CWebTVResolution : public CMenuTarget diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c581f931b..6829f5aa1 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1578,16 +1578,13 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString ( "logo_hdd_dir", g_settings.logo_hdd_dir ); + CWebTVSetup webtvsetup; configfile.setInt32("webtv_xml_auto", g_settings.webtv_xml_auto); //NI int webtv_count = 0; for (std::list::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it) { std::string k = "webtv_xml_" + to_string(webtv_count); //NI - if ( - (*it).empty() - || ((*it).find(WEBTVDIR) != std::string::npos) - || ((*it).find(WEBTVDIR_VAR) != std::string::npos) - ) + if (webtvsetup.webtv_xml_autodir((*it))) continue; configfile.setString(k, *it); webtv_count++;