From 55586bc20a65b9b31b463aa5f6d313564e43e138 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Tue, 30 Aug 2011 23:37:00 +0200 Subject: [PATCH] Use string of element instead of multi section --- wmfs2/src/config.c | 16 ++++------------ wmfs2/src/tag.c | 2 -- wmfs2/wmfsrc2 | 8 ++++---- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/wmfs2/src/config.c b/wmfs2/src/config.c index 1bcf2e9..f83669a 100755 --- a/wmfs2/src/config.c +++ b/wmfs2/src/config.c @@ -16,9 +16,10 @@ static void config_bars(void) { Scr33n *s; - size_t i, n, j, m; - struct conf_sec *sec, **ks, **es; + size_t i, n; + struct conf_sec *sec, **ks; int screenid; + char *elem; /* [bars] */ sec = fetch_section_first(NULL, "bars"); @@ -28,21 +29,12 @@ config_bars(void) /* [bar] */ for(i = 0; i < n; ++i) { - char elem[128] = { 0 }; - - /* [element] */ - es = fetch_section(ks[i], "element"); - m = fetch_section_count(es); - for(j = 0; j < m; ++j) - elem[j] = fetch_opt_first(es[j], "t", "type").str[0]; - + elem = fetch_opt_first(ks[i], "", "elements").str; screenid = fetch_opt_first(ks[i], "-1", "screen").num; SLIST_FOREACH(s, &W->h.screen, next) if(screenid == s->id || screenid == -1) (Infobar*)infobar_new(s, elem); - - free(es); } free(ks); diff --git a/wmfs2/src/tag.c b/wmfs2/src/tag.c index 36a3d18..c395318 100755 --- a/wmfs2/src/tag.c +++ b/wmfs2/src/tag.c @@ -27,8 +27,6 @@ tag_new(Scr33n *s, char *name) void tag_screen(Scr33n *s, Tag *t) { - Infobar *i; - s->seltag = t; infobar_elem_screen_update(s, ElemTag); diff --git a/wmfs2/wmfsrc2 b/wmfs2/wmfsrc2 index c91bf6d..9be0f72 100644 --- a/wmfs2/wmfsrc2 +++ b/wmfs2/wmfsrc2 @@ -5,17 +5,17 @@ [bars] # element type: - # t Tag list - # S statustext + # t Tags + # S Statustext [bar] screen = 0 - [element] type = "t" [/element] + elements = "tt" [/bar] [bar] screen = 1 - [element] type = "t" [/element] + elements = "t" [/bar] [/bars]