correct factory reset handling after optimization
This commit is contained in:
parent
9d25ce8b7e
commit
faadccd6cb
|
@ -91,7 +91,7 @@ bool GwConfigHandler::updateValue(String name, String value){
|
|||
bool GwConfigHandler::reset(bool save){
|
||||
LOG_DEBUG(GwLog::LOG,"reset config");
|
||||
for (int i=0;i<getNumConfig();i++){
|
||||
configs[i]->updateValue(configs[i]->getDefault(),true);
|
||||
configs[i]->updateValue(configs[i]->getDefault());
|
||||
}
|
||||
if (!save) return true;
|
||||
return saveConfig();
|
||||
|
|
|
@ -12,21 +12,16 @@ class GwConfigInterface{
|
|||
bool secret=false;
|
||||
String changedValue;
|
||||
bool hasChangedValue=false;
|
||||
void updateValue(String value,bool cmpDefault=false){
|
||||
hasChangedValue=false;
|
||||
if (cmpDefault){
|
||||
if (value != initialValue) {
|
||||
changedValue=value;
|
||||
hasChangedValue=true;
|
||||
}
|
||||
void updateValue(String value)
|
||||
{
|
||||
hasChangedValue = false;
|
||||
if (value != this->value)
|
||||
{
|
||||
changedValue = value;
|
||||
hasChangedValue = true;
|
||||
}
|
||||
else{
|
||||
if (value != this->value) {
|
||||
changedValue=value;
|
||||
hasChangedValue=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
GwConfigInterface(const String &name, const char * initialValue, bool secret=false){
|
||||
this->name=name;
|
||||
|
|
Loading…
Reference in New Issue