Pi-Star puts a blank for empty values in config files, this breaks default value handling. Implement a work around for XLX URL. Should this be rather addressed on pi-star end ?

This commit is contained in:
Geoffrey Merck F4FXL - KC3FRA 2019-04-18 08:20:27 +02:00
parent 0fff5f489c
commit 87e1a31e7d

View file

@ -760,7 +760,7 @@ m_y(DEFAULT_WINDOW_Y)
m_config->Read(m_name + KEY_XLX_ENABLED, &m_xlxEnabled, DEFAULT_XLX_ENABLED);
m_config->Read(m_name + KEY_XLX_HOSTS_FILE_URL, &m_xlxHostsFileUrl, DEFAULT_XLX_HOSTS_FILE_URL);
if(m_xlxEnabled && m_xlxHostsFileUrl.IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty
if(m_xlxEnabled && m_xlxHostsFileUrl.Trim().IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty
m_xlxHostsFileUrl = DEFAULT_XLX_HOSTS_FILE_URL;
m_config->Read(m_name + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND);
@ -1434,7 +1434,7 @@ m_y(DEFAULT_WINDOW_Y)
} else if (key.IsSameAs(KEY_XLX_ENABLED)) {
val.ToLong(&temp1);
m_xlxEnabled = temp1 == 1L;
} else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.IsEmpty()) { //always load default url if the value in the config file is empty
} else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.Trim().IsEmpty()) { //always load default url if the value in the config file is empty
m_xlxHostsFileUrl = val;
} else if (key.IsSameAs(KEY_STARNET_BAND1)) {
m_starNet1Band = val;