From: Reinhard Pfau Date: Thu, 4 Sep 2008 14:19:43 +0000 (+0000) Subject: libi2ncommon: (reinhard) fixed the "var list does not vanish" problem. X-Git-Tag: v2.6~149 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=ee911942dd157a7b7511637da838418d638c427d;p=libi2ncommon libi2ncommon: (reinhard) fixed the "var list does not vanish" problem. --- diff --git a/configlib/i2n_global_config.cpp b/configlib/i2n_global_config.cpp index 5c4c1e8..332ecfb 100644 --- a/configlib/i2n_global_config.cpp +++ b/configlib/i2n_global_config.cpp @@ -251,8 +251,43 @@ bool feedEm( ConfigData& old_config_data ) continue; } // at this point we don't have (new) data, but we had old data... - //TODO how to handle this case? (reset to initial value??) - // for now, we ignore it. + { + DOUT("had old data"); + StringList values; + + // at this point we need to publish (vanished) value: + HideOutMap::GroupDataType::ValueListType func_list; + hideout_map()[section].getValues(key, func_list); + for(HideOutMap::GroupDataType::ValueListType::iterator func_it= func_list.begin(); + func_it != func_list.end(); + ++func_it) + { + DOUT(" feed iteration"); + if (not (*func_it)) //paranoia + { + continue; + } + if ( (*func_it)->m_feed) + { + //TODO reset the data (to initial value) somehow? + // for now; we just keep the last value... + continue; + } + if ( (*func_it)->m_feed2) + { + if ( not (*func_it)->m_feed2( values ) ) + { + module_logger().error() << "unable to publish [" <
" + ; + result= false; + } + continue; + } + module_logger().error() << "no feeder"; + } + continue; + } } } return result;