From 763788fd716a2c8f5064c913d35d10973c621ef9 Mon Sep 17 00:00:00 2001 From: harbaum Date: Sun, 13 Aug 2006 18:14:03 +0000 Subject: [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 --- property.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'property.c') diff --git a/property.c b/property.c index d465275..8e1e081 100644 --- a/property.c +++ b/property.c @@ -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; } -- cgit v1.2.3