- neutrino: add upgradeSetup function ...

... to upgrade neutrino.conf to new defaults if needed
This commit is contained in:
svenhoefer
2016-03-03 09:04:08 +01:00
committed by M. Liebmann
parent 273dc68da5
commit 66258704bf
3 changed files with 23 additions and 1 deletions

View File

@@ -912,11 +912,32 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.version_pseudo = configfile.getString("version_pseudo", "19700101000000");
if (g_settings.version_pseudo < NEUTRINO_VERSION_PSEUDO)
upgradeSetup(fname);
if(erg)
configfile.setModifiedFlag(true);
return erg;
}
void CNeutrinoApp::upgradeSetup(const char * fname)
{
if (g_settings.version_pseudo < "20160226110000")
{
if (g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items == "7")
{
g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items = "7,31";
configfile.setString("usermenu_tv_yellow", g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items);
}
}
g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO;
configfile.setString("version_pseudo", g_settings.version_pseudo);
if (configfile.getModifiedFlag())
configfile.saveConfig(fname);
}
/**************************************************************************************
* CNeutrinoApp - saveSetup, save the application-settings *
**************************************************************************************/

View File

@@ -162,6 +162,7 @@ public:
void saveSetup(const char * fname);
int loadSetup(const char * fname);
void upgradeSetup(const char * fname);
void loadKeys(const char * fname = NULL);
void saveKeys(const char * fname = NULL);
void SetupTiming();

View File

@@ -1 +1 @@
#define NEUTRINO_VERSION_PSEUDO "19700101000000"
#define NEUTRINO_VERSION_PSEUDO "20160226110000"