From f7fa2cb3c9eee3efa7b685ba0dcf04882a743c0a Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 13 Sep 2010 23:47:24 +0200 Subject: [PATCH] * knrooms(): - use the right values for the type of display - detect properly whether we need to set a default --- webcit/roomops.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/webcit/roomops.c b/webcit/roomops.c index 9da586382..8aed0e6f6 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1105,22 +1105,16 @@ void knrooms(void) set_preference("roomlistview", ListView, 1); } /** Sanitize the input so its safe */ - if((get_preference("roomlistview", &ListView) != 0)|| - ((strcasecmp(ChrPtr(ListView), "folders") != 0) && - (strcasecmp(ChrPtr(ListView), "table") != 0))) + if ((get_preference("roomlistview", &ListView) == 0)|| + ( + (strcasecmp(ChrPtr(ListView), "folders") != 0) && + (strcasecmp(ChrPtr(ListView), "rooms") != 0) + ) + ) { - if (ListView == NULL) { - ListView = NewStrBufPlain(HKEY("rooms")); - set_preference("roomlistview", ListView, 0); - ListView = NULL; - } - else { - ListView = NewStrBufPlain(HKEY("rooms")); - set_preference("roomlistview", ListView, 0); - ListView = NULL; - } + ListView = NewStrBufPlain(HKEY("rooms")); + set_preference("roomlistview", ListView, 0); } - FreeStrBuf(&ListView); url_do_template(); } -- 2.30.2