taglist: use tokenize

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-23 14:09:00 +02:00
parent 4c133bc646
commit e880f7c11b
2 changed files with 16 additions and 11 deletions

View File

@ -30,7 +30,11 @@ right
scale
shadow
shadow_offset
show_empty
text
text_focus
text_normal
text_urgent
ticks_count
ticks_gap
top

View File

@ -26,6 +26,7 @@
#include "event.h"
#include "common/markup.h"
#include "common/configopts.h"
#include "common/tokenize.h"
extern awesome_t globalconf;
@ -258,26 +259,26 @@ taglist_tell(widget_t *widget, const char *property, const char *new_value)
{
taglist_data_t *d = widget->data;
if(!a_strcmp(property, "text_normal"))
switch(a_tokenize(property, -1))
{
case A_TK_TEXT_NORMAL:
p_delete(&d->text_normal);
d->text_normal = a_strdup(new_value);
}
else if(!a_strcmp(property, "text_focus"))
{
break;
case A_TK_TEXT_FOCUS:
p_delete(&d->text_focus);
d->text_focus = a_strdup(new_value);
}
else if(!a_strcmp(property, "text_urgent"))
{
break;
case A_TK_TEXT_URGENT:
p_delete(&d->text_urgent);
d->text_urgent = a_strdup(new_value);
}
else if(!a_strcmp(property, "show_empty"))
break;
case A_TK_SHOW_EMPTY:
d->show_empty = a_strtobool(new_value);
else
break;
default:
return WIDGET_ERROR;
}
return WIDGET_NOERROR;
}