lsedlar / odcs

Forked from odcs 6 years ago
Clone

97e81d4 Only set items from defaults when they're not set

Authored and Committed by qwan 6 years ago
    Only set items from defaults when they're not set
    
    The current implementation is set items from defaults at first and then
    read from conf and override the defaults, this means if an item is
    present in conf, set_item is called twice, and if _setifok_<item> is
    present, it is called twice, and actually deals with the item value from
    defaults in the first time.
    
    In some cases we'd want to do some checking against the item's value in
    _setifok_<item> function, and it will check the default one first, it's
    not necessary and can brings inconvenience when the default one is not
    what we want and we already have valid value specified in conf.
    
    Modified this behaviour to read item values from conf and set them
    first, then read defaults and set_item only when the item is not
    present.
    
        
file modified
+7 -5