mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CUpdateSettings:: allow choose tmp(ramfs,TMPFS_MAGIC) as update dir
This commit is contained in:
@@ -1418,23 +1418,23 @@ void CFileBrowser::paintHead()
|
||||
free(l_name);
|
||||
}
|
||||
|
||||
bool chooserDir(char *setting_dir, bool test_dir, const char *action_str, size_t str_leng)
|
||||
bool chooserDir(char *setting_dir, bool test_dir, const char *action_str, size_t str_leng, bool allow_tmp)
|
||||
{
|
||||
std::string tmp_setting_dir = setting_dir;
|
||||
if(chooserDir(tmp_setting_dir, test_dir, action_str)){
|
||||
if(chooserDir(tmp_setting_dir, test_dir, action_str,allow_tmp)){
|
||||
strncpy(setting_dir,tmp_setting_dir.c_str(), str_leng);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool chooserDir(std::string &setting_dir, bool test_dir, const char *action_str)
|
||||
bool chooserDir(std::string &setting_dir, bool test_dir, const char *action_str, bool allow_tmp)
|
||||
{
|
||||
const char *wrong_str = "Wrong/unsupported";
|
||||
CFileBrowser b;
|
||||
b.Dir_Mode=true;
|
||||
if (b.exec(setting_dir.c_str())) {
|
||||
const char * newdir = b.getSelectedFile()->Name.c_str();
|
||||
if(test_dir && check_dir(newdir)){
|
||||
if(test_dir && check_dir(newdir,allow_tmp)){
|
||||
printf("%s %s dir %s\n",wrong_str ,action_str, newdir);
|
||||
return false;
|
||||
}else {
|
||||
|
Reference in New Issue
Block a user