Browse Source

Use string of element instead of multi section

Martin Duquesnoy 12 years ago
parent
commit
55586bc20a
3 changed files with 8 additions and 18 deletions
  1. 4 12
      wmfs2/src/config.c
  2. 0 2
      wmfs2/src/tag.c
  3. 4 4
      wmfs2/wmfsrc2

+ 4 - 12
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);

+ 0 - 2
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);

+ 4 - 4
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]