diff options
author | harbaum <harbaum@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2006-08-13 18:14:03 +0000 |
---|---|---|
committer | harbaum <harbaum@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2006-08-13 18:14:03 +0000 |
commit | 763788fd716a2c8f5064c913d35d10973c621ef9 (patch) | |
tree | 553a469c55802d218cae6c2f62db3f3ccd4e1927 /property.c | |
parent | 9e6804e49cac8d859b899ae49509ffdf347eda7f (diff) | |
download | lcd4linux-763788fd716a2c8f5064c913d35d10973c621ef9.tar.gz |
[lcd4linux @ 2006-08-13 18:14:03 by harbaum]
Added KVV plugin
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@692 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'property.c')
-rw-r--r-- | property.c | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: property.c,v 1.2 2006/08/13 11:38:20 reinelt Exp $ +/* $Id: property.c,v 1.3 2006/08/13 18:14:03 harbaum Exp $ * * dynamic properties * @@ -23,6 +23,9 @@ * * * $Log: property.c,v $ + * Revision 1.3 2006/08/13 18:14:03 harbaum + * Added KVV plugin + * * Revision 1.2 2006/08/13 11:38:20 reinelt * text widget uses dynamic properties * @@ -93,32 +96,31 @@ int property_eval(PROPERTY * prop) { RESULT old; int update = 1; - + /* this is a bit ugly: we need to remember the old value */ - + old.type = prop->result.type; old.size = prop->result.size; old.number = prop->result.number; - old.string = prop->result.string != NULL ? strdup(prop->result.string) : NULL; - + old.string = prop->result.string != NULL ? strdup(prop->result.string) : NULL; + DelResult(&prop->result); Eval(prop->compiled, &prop->result); - + if (prop->result.type & R_NUMBER && old.type & R_NUMBER && prop->result.number == old.number) { update = 0; } - + if (prop->result.type & R_STRING && old.type & R_STRING && prop->result.size == old.size) { if (prop->result.string == NULL && old.string == NULL) { update = 0; - } - else if (prop->result.string != NULL && old.string != NULL && strcmp(prop->result.string, old.string) == 0) { + } else if (prop->result.string != NULL && old.string != NULL && strcmp(prop->result.string, old.string) == 0) { update = 0; } } - + if (old.string) - free (old.string); + free(old.string); return update; } |