1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

case-insensitivity for /STATUSBAR command

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2463 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-15 22:42:09 +00:00 committed by cras
parent b3beb2c49e
commit 8506f11fa5

View File

@ -163,16 +163,16 @@ static void statusbar_read(STATUSBAR_GROUP_REC *group, CONFIG_NODE *node)
} }
visible_str = config_node_get_str(node, "visible", ""); visible_str = config_node_get_str(node, "visible", "");
if (strcmp(visible_str, "active") == 0) if (g_strcasecmp(visible_str, "active") == 0)
bar->visible = STATUSBAR_VISIBLE_ACTIVE; bar->visible = STATUSBAR_VISIBLE_ACTIVE;
else if (strcmp(visible_str, "inactive") == 0) else if (g_strcasecmp(visible_str, "inactive") == 0)
bar->visible = STATUSBAR_VISIBLE_INACTIVE; bar->visible = STATUSBAR_VISIBLE_INACTIVE;
else else
bar->visible = STATUSBAR_VISIBLE_ALWAYS; bar->visible = STATUSBAR_VISIBLE_ALWAYS;
if (strcmp(config_node_get_str(node, "type", ""), "window") == 0) if (g_strcasecmp(config_node_get_str(node, "type", ""), "window") == 0)
bar->type = STATUSBAR_TYPE_WINDOW; bar->type = STATUSBAR_TYPE_WINDOW;
if (strcmp(config_node_get_str(node, "placement", ""), "top") == 0) if (g_strcasecmp(config_node_get_str(node, "placement", ""), "top") == 0)
bar->placement = STATUSBAR_TOP; bar->placement = STATUSBAR_TOP;
bar->position = config_node_get_int(node, "position", 0); bar->position = config_node_get_int(node, "position", 0);
@ -269,9 +269,9 @@ static void cmd_statusbar_disable(const char *data, void *server,
static void cmd_statusbar_type(const char *data, void *server, static void cmd_statusbar_type(const char *data, void *server,
void *item, CONFIG_NODE *node) void *item, CONFIG_NODE *node)
{ {
if (strcmp(data, "window") == 0) if (g_strcasecmp(data, "window") == 0)
iconfig_node_set_str(node, "type", "window"); iconfig_node_set_str(node, "type", "window");
else if (strcmp(data, "root") == 0) else if (g_strcasecmp(data, "root") == 0)
iconfig_node_set_str(node, "type", "root"); iconfig_node_set_str(node, "type", "root");
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
@ -283,9 +283,9 @@ static void cmd_statusbar_type(const char *data, void *server,
static void cmd_statusbar_placement(const char *data, void *server, static void cmd_statusbar_placement(const char *data, void *server,
void *item, CONFIG_NODE *node) void *item, CONFIG_NODE *node)
{ {
if (strcmp(data, "top") == 0) if (g_strcasecmp(data, "top") == 0)
iconfig_node_set_str(node, "placement", "top"); iconfig_node_set_str(node, "placement", "top");
else if (strcmp(data, "bottom") == 0) else if (g_strcasecmp(data, "bottom") == 0)
iconfig_node_set_str(node, "placement", "bottom"); iconfig_node_set_str(node, "placement", "bottom");
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
@ -304,11 +304,11 @@ static void cmd_statusbar_position(const char *data, void *server,
static void cmd_statusbar_visible(CONFIG_NODE *node, void *server, static void cmd_statusbar_visible(CONFIG_NODE *node, void *server,
void *item, const char *data) void *item, const char *data)
{ {
if (strcmp(data, "always") == 0) if (g_strcasecmp(data, "always") == 0)
iconfig_node_set_str(node, "visible", "always"); iconfig_node_set_str(node, "visible", "always");
else if (strcmp(data, "active") == 0) else if (g_strcasecmp(data, "active") == 0)
iconfig_node_set_str(node, "visible", "active"); iconfig_node_set_str(node, "visible", "active");
else if (strcmp(data, "inactive") == 0) else if (g_strcasecmp(data, "inactive") == 0)
iconfig_node_set_str(node, "visible", "inactive"); iconfig_node_set_str(node, "visible", "inactive");
else { else {
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
@ -386,7 +386,7 @@ static void cmd_statusbar_add(const char *data, void *server,
value = g_hash_table_lookup(optlist, "alignment"); value = g_hash_table_lookup(optlist, "alignment");
if (value != NULL) { if (value != NULL) {
iconfig_node_set_str(node, "alignment", iconfig_node_set_str(node, "alignment",
strcmp(value, "right") == 0 ? g_strcasecmp(value, "right") == 0 ?
"right" : NULL); "right" : NULL);
} }
@ -428,6 +428,7 @@ static void cmd_statusbar(const char *data)
/* call the subcommand */ /* call the subcommand */
signal = g_strconcat("command statusbar ", cmd, NULL); signal = g_strconcat("command statusbar ", cmd, NULL);
g_strdown(signal);
if (!signal_emit(signal, 4, params, NULL, NULL, node)) { if (!signal_emit(signal, 4, params, NULL, NULL, node)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
TXT_STATUSBAR_UNKNOWN_COMMAND, cmd); TXT_STATUSBAR_UNKNOWN_COMMAND, cmd);