diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-28 19:10:05 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-28 19:10:05 +0200 |
commit | 96ff7248ef334fa3da138090e5a0cb08d5fae360 (patch) | |
tree | b1c6a61992455393a67491d51c5c6da28cd6ba66 | |
parent | eac442a855dfe2299eeac11d0a3a3c47d7853695 (diff) | |
download | weechat-96ff7248ef334fa3da138090e5a0cb08d5fae360.zip |
core: remove obsolete function gui_nicklist_get_max_length
-rw-r--r-- | src/gui/gui-nicklist.c | 49 | ||||
-rw-r--r-- | tests/unit/gui/test-gui-nicklist.cpp | 9 |
2 files changed, 0 insertions, 58 deletions
diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c index 337ea3f60..1c9d7fd2a 100644 --- a/src/gui/gui-nicklist.c +++ b/src/gui/gui-nicklist.c @@ -817,55 +817,6 @@ gui_nicklist_get_group_start (const char *name) } /* - * Returns longer nickname in the nicklist. - */ - -int -gui_nicklist_get_max_length (struct t_gui_buffer *buffer, - struct t_gui_nick_group *group) -{ - int length, max_length; - struct t_gui_nick_group *ptr_group; - struct t_gui_nick *ptr_nick; - - if (!buffer) - return 0; - - max_length = 0; - for (ptr_group = (group) ? group : buffer->nicklist_root; - ptr_group; ptr_group = ptr_group->next_group) - { - if (buffer->nicklist_display_groups && ptr_group->visible) - { - length = utf8_strlen_screen (gui_nicklist_get_group_start (ptr_group->name)) + - ptr_group->level - 1; - if (length > max_length) - max_length = length; - } - for (ptr_nick = ptr_group->nicks; ptr_nick; - ptr_nick = ptr_nick->next_nick) - { - if (ptr_nick->visible) - { - if (buffer->nicklist_display_groups) - length = utf8_strlen_screen (ptr_nick->name) + ptr_group->level + 1; - else - length = utf8_strlen_screen (ptr_nick->name) + 1; - if (length > max_length) - max_length = length; - } - } - if (ptr_group->children) - { - length = gui_nicklist_get_max_length (buffer, ptr_group->children); - if (length > max_length) - max_length = length; - } - } - return max_length; -} - -/* * Computes visible_count variable for a nicklist. */ diff --git a/tests/unit/gui/test-gui-nicklist.cpp b/tests/unit/gui/test-gui-nicklist.cpp index 74e523816..65112a080 100644 --- a/tests/unit/gui/test-gui-nicklist.cpp +++ b/tests/unit/gui/test-gui-nicklist.cpp @@ -239,16 +239,7 @@ TEST(GuiNicklist, GetNextItem) TEST(GuiNicklist, GetGroupStart) { /* TODO: write tests */ -} -/* - * Tests functions: - * gui_nicklist_get_max_length - */ - -TEST(GuiNicklist, GetMaxLength) -{ - /* TODO: write tests */ } /* |