diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-10-18 22:36:18 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-10-18 22:36:18 +0200 |
commit | 2bd4428f45b168ee12866dc5a2d9b960459e2182 (patch) | |
tree | 4507772e4ce11dd48b00bb3392e508f97a920f3a /src/gui | |
parent | 3b81a4746a4e0b648df1e05c79e077cc93b69459 (diff) | |
download | weechat-2bd4428f45b168ee12866dc5a2d9b960459e2182.zip |
Remove unused option look.input_format, fix refresh bug with input prompt for IRC buffers
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-bar-item.c | 25 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 23 | ||||
-rw-r--r-- | src/gui/gui-buffer.h | 1 | ||||
-rw-r--r-- | src/gui/gui-completion.c | 16 | ||||
-rw-r--r-- | src/gui/gui-input.c | 74 | ||||
-rw-r--r-- | src/gui/gui-input.h | 1 |
6 files changed, 2 insertions, 138 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index e2820a6fb..d7b2d4b77 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -667,35 +667,14 @@ gui_bar_item_default_input_prompt (void *data, struct t_gui_bar_item *item, struct t_gui_window *window, int max_width, int max_height) { - char *buf; - int length; - /* make C compiler happy */ (void) data; (void) item; + (void) window; (void) max_width; (void) max_height; - if (!window) - window = gui_current_window; - - if (!window->buffer->input_nick) - return NULL; - - length = strlen (window->buffer->input_nick); - if (length == 0) - return NULL; - - length += 64 + 1; - buf = malloc (length); - if (buf) - { - snprintf (buf, length, "%s%s", - gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_input_nick))), - window->buffer->input_nick); - } - - return buf; + return NULL; } /* diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index b5298d004..a3e8acf80 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -202,7 +202,6 @@ gui_buffer_new (struct t_weechat_plugin *plugin, new_buffer->input = 1; new_buffer->input_callback = input_callback; new_buffer->input_callback_data = input_callback_data; - new_buffer->input_nick = NULL; new_buffer->input_buffer_alloc = GUI_BUFFER_INPUT_BLOCK_SIZE; new_buffer->input_buffer = malloc (GUI_BUFFER_INPUT_BLOCK_SIZE); new_buffer->input_buffer[0] = '\0'; @@ -354,8 +353,6 @@ gui_buffer_get_string (struct t_gui_buffer *buffer, const char *property) return buffer->name; else if (string_strcasecmp (property, "title") == 0) return buffer->title; - else if (string_strcasecmp (property, "nick") == 0) - return buffer->input_nick; } return NULL; @@ -482,19 +479,6 @@ gui_buffer_set_nicklist_display_groups (struct t_gui_buffer *buffer, } /* - * gui_buffer_set_nick: set nick for a buffer - */ - -void -gui_buffer_set_nick (struct t_gui_buffer *buffer, const char *new_nick) -{ - if (buffer->input_nick) - free (buffer->input_nick); - buffer->input_nick = (new_nick && new_nick[0]) ? strdup (new_nick) : NULL; - gui_buffer_ask_input_refresh (buffer, 1); -} - -/* * gui_buffer_set_highlight_words: set highlight words for a buffer */ @@ -670,10 +654,6 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property, if (error && !error[0]) gui_buffer_set_nicklist_display_groups (buffer, number); } - else if (string_strcasecmp (property, "nick") == 0) - { - gui_buffer_set_nick (buffer, value_str); - } else if (string_strcasecmp (property, "highlight_words") == 0) { gui_buffer_set_highlight_words (buffer, value_str); @@ -1247,8 +1227,6 @@ gui_buffer_add_to_infolist (struct t_infolist *infolist, return 0; if (!infolist_new_var_integer (ptr_item, "input", buffer->input)) return 0; - if (!infolist_new_var_string (ptr_item, "input_nick", buffer->input_nick)) - return 0; if (!infolist_new_var_string (ptr_item, "input_string", buffer->input_buffer)) return 0; if (!infolist_new_var_string (ptr_item, "highlight_words", buffer->highlight_words)) @@ -1443,7 +1421,6 @@ gui_buffer_print_log () log_printf (" input. . . . . . . . . : %d", ptr_buffer->input); log_printf (" input_callback . . . . : 0x%x", ptr_buffer->input_callback); log_printf (" input_callback_data. . : 0x%x", ptr_buffer->input_callback_data); - log_printf (" input_nick . . . . . . : '%s'", ptr_buffer->input_nick); log_printf (" input_buffer . . . . . : '%s'", ptr_buffer->input_buffer); log_printf (" input_buffer_alloc . . : %d", ptr_buffer->input_buffer_alloc); log_printf (" input_buffer_size. . . : %d", ptr_buffer->input_buffer_size); diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h index 225f2bb5e..2ac955aaf 100644 --- a/src/gui/gui-buffer.h +++ b/src/gui/gui-buffer.h @@ -119,7 +119,6 @@ struct t_gui_buffer const char *input_data); void *input_callback_data; /* data for callback */ /* to this buffer */ - char *input_nick; /* self nick */ char *input_buffer; /* input buffer */ int input_buffer_alloc; /* input buffer: allocated size */ int input_buffer_size; /* buffer size in bytes */ diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index 1e313e940..5dfb20a3c 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -527,19 +527,6 @@ gui_completion_list_add_infolist_hooks (struct t_gui_completion *completion) } /* - * gui_completion_list_add_self_nick: add self nick on server to completion list - */ - -void -gui_completion_list_add_self_nick (struct t_gui_completion *completion) -{ - if (completion->buffer->input_nick) - gui_completion_list_add (completion, - completion->buffer->input_nick, - 0, WEECHAT_LIST_POS_SORT); -} - -/* * gui_completion_list_add_nicks: add nicks to completion list */ @@ -953,9 +940,6 @@ gui_completion_build_list_template (struct t_gui_completion *completion, case 'I': /* infolists hooked */ gui_completion_list_add_infolist_hooks (completion); break; - case 'm': /* self nickname */ - gui_completion_list_add_self_nick (completion); - break; case 'n': /* nick */ gui_completion_list_add_nicks (completion); break; diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index 439cc18ac..dd45a4754 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -198,80 +198,6 @@ gui_input_insert_string (struct t_gui_buffer *buffer, const char *string, } /* - * gui_input_get_prompt_length: return input prompt length (displayed on screen) - */ - -int -gui_input_get_prompt_length (struct t_gui_buffer *buffer) -{ - char *pos, saved_char; - int char_size, length; - - if (buffer->text_search != GUI_TEXT_SEARCH_DISABLED) - { - if (buffer->text_search_exact) - return utf8_strlen_screen (_("Text search (exact): ")); - else - return utf8_strlen_screen (_("Text search: ")); - } - - length = 0; - pos = CONFIG_STRING(config_look_input_format); - while (pos && pos[0]) - { - switch (pos[0]) - { - case '%': - pos++; - switch (pos[0]) - { - case 'c': /* buffer name */ - length += utf8_strlen_screen (buffer->name); - pos++; - break; - case 'm': // nick modes - /*if (GUI_SERVER(buffer) && GUI_SERVER(buffer)->is_connected) - { - if (GUI_SERVER(buffer)->nick_modes - && GUI_SERVER(buffer)->nick_modes[0]) - length += strlen (GUI_SERVER(buffer)->nick_modes); - }*/ - pos++; - break; - case 'n': /* nick */ - if (buffer->input_nick) - length += utf8_strlen_screen (buffer->input_nick); - pos++; - break; - default: - length++; - if (pos[0]) - { - if (pos[0] == '%') - pos++; - else - { - length++; - pos += utf8_char_size (pos); - } - } - break; - } - break; - default: - char_size = utf8_char_size (pos); - saved_char = pos[char_size]; - pos[char_size] = '\0'; - length += utf8_strlen_screen (pos); - pos[char_size] = saved_char; - pos += char_size; - break; - } - } - return length; -} - -/* * gui_input_clipboard_copy: copy string into clipboard */ diff --git a/src/gui/gui-input.h b/src/gui/gui-input.h index 9cf4c11e6..c54d3a831 100644 --- a/src/gui/gui-input.h +++ b/src/gui/gui-input.h @@ -37,7 +37,6 @@ extern void gui_input_move (struct t_gui_buffer *buffer, char *target, const char *source, int size); extern int gui_input_insert_string (struct t_gui_buffer *buffer, const char *string, int pos); -extern int gui_input_get_prompt_length (struct t_gui_buffer *buffer); extern void gui_input_return (); extern void gui_input_clipboard_paste (); extern void gui_input_complete_next (); |