Re: [frogs] Stepping into the code for nested properties |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: "frogs@xxxxxxxxxxx" <frogs@xxxxxxxxxxx>
- Subject: Re: [frogs] Stepping into the code for nested properties
- From: Rodolfo Zitellini <xhero.gm@xxxxxxxxx>
- Date: Fri, 14 May 2010 12:14:45 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=Z2YubuPpFXF3c9jCpERh3aVZYzEtXV27CaCqYp6Megc=; b=UKWp9N5sP2cxKxCEFi1uOI+cIb3OjdP96BAlPPzZlxNbyDlkmCPjAKSldWBH4j8sg0 XOfA2NwMS9z/LB2VZdshZx7s45PTkoC+JZNp3+Ywp1hlGnaGhzdlGlu4DzWLXCLmaRjF oZ90vTkiK6A2vh5s5LP22fuVVA4RII69vGrjM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=CuELbNmeeXhNmQJifCJ1BQyHkvYLJBjwK0B7KKUgjFHl7iQjCxVBIlKU+clmDkwrI+ sy9gzU2f6a7Dg8yWGRe7LM3HhJMLSMVV/aLiMCk9h7CdZ86/KTEOLLMjpviq7FP7lfmf bG1CU2Q774+RHba7tWzj91DQiROZs/+QTz1Zo=
Sorry, I preovously replyed only to Carl :)
I did some more investigation on the issue, and I think it all bolis
down simply to the fact that reverting a nested property will revert
it even if it was not overridden before.
Nested reverting works like this:
1) Get the first instance of the nested proeprty list
2) get the first instance of the eventual sublist of properties
3) find the first instance of the property
4) drop it
This works only assuming that you always have two copies (overridden
and original) of the property you are reverting in the very first
instance of it's parent list, with the overridden value in the head of
the list.
I think we can just modify nested_property_revert_alist() to prevent
it from dropping non-overridden values. We can simply check if we find
at least another copy of the property, so we can assume safely that
the first one we drop is the overridden one. If just only one copy is
found we can assume that it is the original, and not drop it.
What do you think about it? I made a slight mod
nested_property_revert_alist() and the idea seems to work, if you want
I can try to post a little patch :)
---
----
Join the Frogs!