* knrooms(): don't force storing preferences
authorWilfried Göesgens <willi@citadel.org>
Thu, 8 Jul 2010 18:55:05 +0000 (18:55 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 8 Jul 2010 18:55:05 +0000 (18:55 +0000)
webcit/roomops.c

index d270dfc775e26ff6432b0d1b60098f19d596230f..5e7359b5fd6e8455077bd716e20de54a1a8cbac7 100644 (file)
@@ -3009,19 +3009,22 @@ void knrooms(void)
                set_preference("roomlistview", ListView, 1);
        }
        /** Sanitize the input so its safe */
-       if(!get_preference("roomlistview", &ListView) ||
+       if((get_preference("roomlistview", &ListView) != 0)||
           ((strcasecmp(ChrPtr(ListView), "folders") != 0) &&
            (strcasecmp(ChrPtr(ListView), "table") != 0))) 
        {
                if (ListView == NULL) {
                        ListView = NewStrBufPlain(HKEY("rooms"));
                        set_preference("roomlistview", ListView, 0);
+                       ListView = NULL;
                }
                else {
-                       StrBufPlain(ListView, HKEY("rooms"));
-                       save_preferences();
+                       ListView = NewStrBufPlain(HKEY("rooms"));
+                       set_preference("roomlistview", ListView, 0);
+                       ListView = NULL;
                }
        }
+       FreeStrBuf(&ListView);
        url_do_template();
 }