mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-13 04:15:50 +01:00
- improved behaviour for the shared appicon thing.
- added a 'Bool recursive' flag to WMMergePLDictionaries() in WINGs
This commit is contained in:
@@ -1211,16 +1211,25 @@ WMRemoveFromPLDictionary(WMPropList *plist, WMPropList *key)
|
||||
|
||||
|
||||
WMPropList*
|
||||
WMMergePLDictionaries(WMPropList *dest, WMPropList *source)
|
||||
WMMergePLDictionaries(WMPropList *dest, WMPropList *source, Bool recursive)
|
||||
{
|
||||
WMPropList *key, *value;
|
||||
WMPropList *key, *value, *dvalue;
|
||||
WMHashEnumerator e;
|
||||
|
||||
wassertr(source->type==WPLDictionary && dest->type==WPLDictionary);
|
||||
|
||||
e = WMEnumerateHashTable(source->d.dict);
|
||||
while (WMNextHashEnumeratorItemAndKey(&e, (void**)&value, (void**)&key)) {
|
||||
WMPutInPLDictionary(dest, key, value);
|
||||
if (recursive && value->type==WPLDictionary) {
|
||||
dvalue = WMGetFromPLDictionary(dest, key);
|
||||
if (dvalue && dvalue->type==WPLDictionary) {
|
||||
WMMergePLDictionaries(dvalue, value, recursive);
|
||||
} else {
|
||||
WMPutInPLDictionary(dest, key, value);
|
||||
}
|
||||
} else {
|
||||
WMPutInPLDictionary(dest, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
return dest;
|
||||
|
||||
Reference in New Issue
Block a user