diff options
-rw-r--r-- | ChangeLog.adoc | 2 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 391c4546e..ff8cda978 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -39,6 +39,7 @@ New features:: Bug fixes:: + * core: set buffer name, short name and title only if the value has changed * core: fix scrolling up in bare mode when switched to bare mode at the top of the buffer (issue #899, issue #978) * core: optimize load of configuration files * core: fix window separators not respecting window splits (issue #630) @@ -50,6 +51,7 @@ Bug fixes:: * irc: use path from option xfer.file.upload_path to complete filename in command "/dcc send" (issue #60) * logger: fix write in log file if it has been deleted or renamed (issue #123) * python: send "bytes" instead of "str" to callbacks in Python 3 when the string is not UTF-8 valid (issue #1389) + * relay: send message "_buffer_title_changed" to clients only when the title is changed * xfer: fix memory leak when a xfer is freed and when the plugin is unloaded Tests:: diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 669e16a90..ae3e82d88 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1294,6 +1294,10 @@ gui_buffer_set_name (struct t_gui_buffer *buffer, const char *name) if (!buffer || !name || !name[0]) return; + /* same name? */ + if (buffer->name && (strcmp (buffer->name, name) == 0)) + return; + if (buffer->name) free (buffer->name); buffer->name = strdup (name); @@ -1315,6 +1319,14 @@ gui_buffer_set_short_name (struct t_gui_buffer *buffer, const char *short_name) if (!buffer) return; + /* same short name? */ + if ((!buffer->short_name && !short_name) + || (buffer->short_name && short_name + && (strcmp (buffer->short_name, short_name) == 0))) + { + return; + } + if (buffer->short_name) { free (buffer->short_name); @@ -1338,7 +1350,11 @@ gui_buffer_set_short_name (struct t_gui_buffer *buffer, const char *short_name) void gui_buffer_set_type (struct t_gui_buffer *buffer, enum t_gui_buffer_type type) { - if (!buffer || (buffer->type == type)) + if (!buffer) + return; + + /* same type? */ + if (buffer->type == type) return; gui_line_free_all (buffer); @@ -1363,6 +1379,14 @@ gui_buffer_set_title (struct t_gui_buffer *buffer, const char *new_title) if (!buffer) return; + /* same title? */ + if ((!buffer->title && !new_title) + || (buffer->title && new_title + && (strcmp (buffer->title, new_title) == 0))) + { + return; + } + if (buffer->title) free (buffer->title); buffer->title = (new_title && new_title[0]) ? strdup (new_title) : NULL; |