Aggiunto metodo setconfig() per cambiare il tipo di file di configurazione
relativo alla confapp. Corretta la lettura/salvataggio di campi array, identificati da FIELD xxx[nn]. git-svn-id: svn://10.65.10.50/trunk@3598 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ce341c3cb2
commit
2caafb668b
@ -72,8 +72,10 @@ void TConfig_application::do_config(int m)
|
||||
TMask_field& f = m.fld(i);
|
||||
if (f.field() != NULL)
|
||||
{
|
||||
const char* fname = f.field()->name();
|
||||
TString& oldvl = cnf.get(fname);
|
||||
const TFieldref* fr = f.field();
|
||||
const char* fname = fr->name();
|
||||
const int index = fr->to();
|
||||
TString& oldvl = cnf.get(fname,NULL, index > -1 ? index : -1);
|
||||
if (!oldvl.empty())
|
||||
f.set(oldvl);
|
||||
}
|
||||
@ -98,6 +100,7 @@ void TConfig_application::do_config(int m)
|
||||
{
|
||||
const char* fname = f.field()->name();
|
||||
const char* value = f.get();
|
||||
const int index = f.field()->to();
|
||||
const char* oldvl = cnf.get(fname);
|
||||
|
||||
if (!tosave)
|
||||
@ -106,7 +109,7 @@ void TConfig_application::do_config(int m)
|
||||
if (!tosave) break;
|
||||
|
||||
if (postprocess_config_changed(par, fname, oldvl, value))
|
||||
cnf.set(fname, value, NULL, TRUE);
|
||||
cnf.set(fname, value, NULL, TRUE, index > -1 ? index : -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +80,8 @@ protected:
|
||||
|
||||
// @access Public Member
|
||||
public:
|
||||
// @cmember Setta il tipo di file di configurazione al quale e' associata l'applicazione
|
||||
void set_config(int which) {_which_config = which;}
|
||||
// @cmember Costruttore
|
||||
TConfig_application(int which_config = CONFIG_GENERAL) : _which_config(which_config)
|
||||
{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user