mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CThemes: make saveFile and readFile accept const char* param
this removes the need for ugly (char *) casts
This commit is contained in:
committed by
Jacek Jendrzej
parent
63d8c8e90b
commit
3fa68cae90
@@ -82,10 +82,10 @@ int CThemes::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
if ( strstr(themeFile.c_str(), "{U}") != 0 )
|
if ( strstr(themeFile.c_str(), "{U}") != 0 )
|
||||||
{
|
{
|
||||||
themeFile.erase(0, 3);
|
themeFile.erase(0, 3);
|
||||||
readFile((char*)((std::string)THEMEDIR_VAR + themeFile + FILE_PREFIX).c_str());
|
readFile(((std::string)THEMEDIR_VAR + themeFile + FILE_PREFIX).c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
readFile((char*)((std::string)THEMEDIR + themeFile + FILE_PREFIX).c_str());
|
readFile(((std::string)THEMEDIR + themeFile + FILE_PREFIX).c_str());
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -177,7 +177,7 @@ int CThemes::Show()
|
|||||||
int res = themes.exec(NULL, "");
|
int res = themes.exec(NULL, "");
|
||||||
|
|
||||||
if (!file_name.empty()) {
|
if (!file_name.empty()) {
|
||||||
saveFile((char*)((std::string)THEMEDIR_VAR + file_name + FILE_PREFIX).c_str());
|
saveFile(((std::string)THEMEDIR_VAR + file_name + FILE_PREFIX).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasThemeChanged) {
|
if (hasThemeChanged) {
|
||||||
@@ -203,7 +203,7 @@ void CThemes::rememberOldTheme(bool remember)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CThemes::readFile(char* themename)
|
void CThemes::readFile(const char *themename)
|
||||||
{
|
{
|
||||||
if(themefile.loadConfig(themename))
|
if(themefile.loadConfig(themename))
|
||||||
{
|
{
|
||||||
@@ -218,7 +218,7 @@ void CThemes::readFile(char* themename)
|
|||||||
printf("[neutrino theme] %s not found\n", themename);
|
printf("[neutrino theme] %s not found\n", themename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CThemes::saveFile(char * themename)
|
void CThemes::saveFile(const char *themename)
|
||||||
{
|
{
|
||||||
setTheme(themefile);
|
setTheme(themefile);
|
||||||
|
|
||||||
|
@@ -40,8 +40,8 @@ class CThemes : public CMenuTarget, CChangeObserver
|
|||||||
bool hasThemeChanged;
|
bool hasThemeChanged;
|
||||||
|
|
||||||
int Show();
|
int Show();
|
||||||
void readFile(char* themename);
|
void readFile(const char *themename);
|
||||||
void saveFile(char* themename);
|
void saveFile(const char *themename);
|
||||||
void readThemes(CMenuWidget &);
|
void readThemes(CMenuWidget &);
|
||||||
void rememberOldTheme(bool remember);
|
void rememberOldTheme(bool remember);
|
||||||
void move_userDir();
|
void move_userDir();
|
||||||
|
Reference in New Issue
Block a user