summaryrefslogtreecommitdiff
path: root/navit/script.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-05-26 13:20:57 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-05-26 13:20:57 +0000
commitb9c49be14ce56ce0f64ff43b099f3c7d0f59e303 (patch)
treed155f733d4c89ae4383374c3ef53a205457133f0 /navit/script.c
parentf6314c3a31db5c11d5ee83892af072da9b125a4b (diff)
downloadnavit-svn-b9c49be14ce56ce0f64ff43b099f3c7d0f59e303.tar.gz
Add:Core:Allow refresh_cond to specify when script should be run
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5514 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/script.c')
-rw-r--r--navit/script.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/navit/script.c b/navit/script.c
index 636409db..5419aee3 100644
--- a/navit/script.c
+++ b/navit/script.c
@@ -31,6 +31,7 @@ struct script
struct attr parent;
struct callback *cb;
struct event_timeout *timeout;
+ struct command_saved *cs;
};
static void
@@ -50,6 +51,12 @@ static int
script_set_attr_int(struct script *scr, struct attr *attr)
{
switch (attr->type) {
+ case attr_refresh_cond:
+ dbg(0,"refresh_cond\n");
+ if (scr->cs)
+ command_saved_destroy(scr->cs);
+ scr->cs=command_saved_attr_new(attr->u.str, &scr->parent, scr->cb, 0);
+ return 1;
case attr_update_period:
if (scr->timeout)
event_remove_timeout(scr->timeout);
@@ -82,6 +89,8 @@ script_destroy(struct script *scr)
dbg(0,"enter %p\n",scr);
if (scr->timeout)
event_remove_timeout(scr->timeout);
+ if (scr->cs)
+ command_saved_destroy(scr->cs);
callback_destroy(scr->cb);
attr_list_free(scr->attrs);
g_free(scr);