widget: Completely stop using a_tokenize()

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-09-02 18:57:18 +02:00
parent 5415c5fbc4
commit dbe237319b
1 changed files with 4 additions and 13 deletions

View File

@ -502,24 +502,15 @@ luaA_widget_get_type(lua_State *L, widget_t *w)
static int static int
luaA_widget_set_type(lua_State *L, widget_t *w) luaA_widget_set_type(lua_State *L, widget_t *w)
{ {
size_t len; const char *type = luaL_checkstring(L, -1);
const char *type = luaL_checklstring(L, -1, &len);
widget_constructor_t *wc = NULL; widget_constructor_t *wc = NULL;
switch(a_tokenize(type, len)) if(a_strcmp(type, "textbox") == 0)
{
case A_TK_TEXTBOX:
wc = widget_textbox; wc = widget_textbox;
break; else if(a_strcmp(type, "systray") == 0)
case A_TK_SYSTRAY:
wc = widget_systray; wc = widget_systray;
break; else if(a_strcmp(type, "imagebox") == 0)
case A_TK_IMAGEBOX:
wc = widget_imagebox; wc = widget_imagebox;
break;
default:
break;
}
if(!wc) if(!wc)
luaL_error(L, "unknown widget type: %s", type); luaL_error(L, "unknown widget type: %s", type);