CUpdateSettings:: allow choose tmp(ramfs,TMPFS_MAGIC) as update dir

Origin commit data
------------------
Branch: ni/coolstream
Commit: 6f07cbe3dd
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2013-10-08 (Tue, 08 Oct 2013)

Origin message was:
------------------
CUpdateSettings:: allow choose tmp(ramfs,TMPFS_MAGIC) as update dir

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2013-10-08 10:10:10 +02:00
parent af33300905
commit 07ccabf7c3
5 changed files with 16 additions and 12 deletions

View File

@@ -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 {