summaryrefslogtreecommitdiff
path: root/src/gui/gui-bar-item.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-06-11 17:00:07 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-06-11 17:00:07 +0200
commit63bc14e805d88162aae8498d8a798974da742269 (patch)
tree02151b5029564bf830fbd58fe7ef4a94157d8a8f /src/gui/gui-bar-item.c
parentb54af6af0be62ef1ad3c02b93bc99085d5b69116 (diff)
downloadweechat-63bc14e805d88162aae8498d8a798974da742269.zip
Fix refresh of bar item when it is used more than one time in a bar
Diffstat (limited to 'src/gui/gui-bar-item.c')
-rw-r--r--src/gui/gui-bar-item.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index e29183d08..97c826cdb 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -452,30 +452,38 @@ gui_bar_item_update (const char *item_name)
for (ptr_bar = gui_bars; ptr_bar; ptr_bar = ptr_bar->next_bar)
{
- gui_bar_get_item_index (ptr_bar, item_name, &index_item, &index_subitem);
- if ((index_item >= 0) && (index_subitem >= 0))
+ for (index_item = 0; index_item < ptr_bar->items_count; index_item++)
{
- if (ptr_bar->bar_window)
+ for (index_subitem = 0;
+ index_subitem < ptr_bar->items_subcount[index_item];
+ index_subitem++)
{
- ptr_bar->bar_window->items_refresh_needed[index_item][index_subitem] = 1;
- }
- else
- {
- for (ptr_window = gui_windows; ptr_window;
- ptr_window = ptr_window->next_window)
+ if (gui_bar_item_string_is_item (ptr_bar->items_array[index_item][index_subitem],
+ item_name))
{
- for (ptr_bar_window = ptr_window->bar_windows;
- ptr_bar_window;
- ptr_bar_window = ptr_bar_window->next_bar_window)
+ if (ptr_bar->bar_window)
+ {
+ ptr_bar->bar_window->items_refresh_needed[index_item][index_subitem] = 1;
+ }
+ else
{
- if (ptr_bar_window->bar == ptr_bar)
+ for (ptr_window = gui_windows; ptr_window;
+ ptr_window = ptr_window->next_window)
{
- ptr_bar_window->items_refresh_needed[index_item][index_subitem] = 1;
+ for (ptr_bar_window = ptr_window->bar_windows;
+ ptr_bar_window;
+ ptr_bar_window = ptr_bar_window->next_bar_window)
+ {
+ if (ptr_bar_window->bar == ptr_bar)
+ {
+ ptr_bar_window->items_refresh_needed[index_item][index_subitem] = 1;
+ }
+ }
}
}
+ gui_bar_ask_refresh (ptr_bar);
}
}
- gui_bar_ask_refresh (ptr_bar);
}
}
}