wibox: remove name

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-09-21 11:42:54 +02:00
parent ef85ed92b7
commit 14c5644fbf
3 changed files with 2 additions and 19 deletions

View File

@ -484,7 +484,7 @@ static int
luaA_statusbar_tostring(lua_State *L)
{
wibox_t **p = luaA_checkudata(L, 1, "statusbar");
lua_pushfstring(L, "[statusbar udata(%p) name(%s)]", *p, (*p)->name);
lua_pushfstring(L, "[statusbar udata(%p)]", *p);
return 1;
}
@ -492,7 +492,7 @@ luaA_statusbar_tostring(lua_State *L)
* \param L The Lua VM state.
*
* \luastack
* \lparam A table with at least a name attribute. Optionaly defined values are:
* \lparam A table with optionaly defined values:
* position, align, fg, bg, width and height.
* \lreturn A brand new statusbar.
*/
@ -507,13 +507,8 @@ luaA_statusbar_new(lua_State *L)
luaA_checktable(L, 2);
if(!(buf = luaA_getopt_string(L, 2, "name", NULL)))
luaL_error(L, "object statusbar must have a name");
sb = p_new(wibox_t, 1);
sb->name = a_strdup(buf);
sb->colors.fg = globalconf.colors.fg;
if((buf = luaA_getopt_lstring(L, 2, "fg", NULL, &len)))
reqs[++reqs_nbr] = xcolor_init_unchecked(&sb->colors.fg, buf, len);
@ -671,15 +666,6 @@ luaA_statusbar_newindex(lua_State *L)
luaL_error(L, "this statusbar is already on screen %d",
(*statusbar)->screen + 1);
/* Check for uniq name and id. */
for(int i = 0; i < globalconf.screens[screen].statusbars.len; i++)
{
wibox_t *s = globalconf.screens[screen].statusbars.tab[i];
if(!a_strcmp(s->name, (*statusbar)->name))
luaL_error(L, "a statusbar with that name is already on screen %d\n",
screen + 1);
}
statusbar_remove(*statusbar);
(*statusbar)->screen = screen;

View File

@ -84,8 +84,6 @@ typedef struct
int refcount;
/** Window */
simple_window_t sw;
/** Wibox name */
char *name;
/** Box width and height */
uint16_t width, height;
/** Box position */

View File

@ -33,7 +33,6 @@ wibox_delete(wibox_t **wibox)
{
simplewindow_wipe(&(*wibox)->sw);
widget_node_list_wipe(&(*wibox)->widgets);
p_delete(&(*wibox)->name);
p_delete(wibox);
}