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 scale
shadow shadow
shadow_offset shadow_offset
show_empty
text text
text_focus
text_normal
text_urgent
ticks_count ticks_count
ticks_gap ticks_gap
top top

View File

@ -26,6 +26,7 @@
#include "event.h" #include "event.h"
#include "common/markup.h" #include "common/markup.h"
#include "common/configopts.h" #include "common/configopts.h"
#include "common/tokenize.h"
extern awesome_t globalconf; 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; 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); p_delete(&d->text_normal);
d->text_normal = a_strdup(new_value); d->text_normal = a_strdup(new_value);
} break;
else if(!a_strcmp(property, "text_focus")) case A_TK_TEXT_FOCUS:
{
p_delete(&d->text_focus); p_delete(&d->text_focus);
d->text_focus = a_strdup(new_value); d->text_focus = a_strdup(new_value);
} break;
else if(!a_strcmp(property, "text_urgent")) case A_TK_TEXT_URGENT:
{
p_delete(&d->text_urgent); p_delete(&d->text_urgent);
d->text_urgent = a_strdup(new_value); d->text_urgent = a_strdup(new_value);
} break;
else if(!a_strcmp(property, "show_empty")) case A_TK_SHOW_EMPTY:
d->show_empty = a_strtobool(new_value); d->show_empty = a_strtobool(new_value);
else break;
default:
return WIDGET_ERROR; return WIDGET_ERROR;
}
return WIDGET_NOERROR; return WIDGET_NOERROR;
} }