summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/xfer/xfer-buffer.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c
index 4c27b5d9f..fab8aabec 100644
--- a/src/plugins/xfer/xfer-buffer.c
+++ b/src/plugins/xfer/xfer-buffer.c
@@ -346,20 +346,31 @@ xfer_buffer_close_cb (const void *pointer, void *data,
void
xfer_buffer_open ()
{
- if (!xfer_buffer)
+ struct t_hashtable *buffer_props;
+
+ if (xfer_buffer)
+ return;
+
+ buffer_props = weechat_hashtable_new (
+ 32,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL, NULL);
+ if (buffer_props)
{
- xfer_buffer = weechat_buffer_new (XFER_BUFFER_NAME,
- &xfer_buffer_input_cb, NULL, NULL,
- &xfer_buffer_close_cb, NULL, NULL);
-
- /* failed to create buffer ? then exit */
- if (!xfer_buffer)
- return;
-
- weechat_buffer_set (xfer_buffer, "type", "free");
- weechat_buffer_set (xfer_buffer, "title", _("Xfer list"));
- weechat_buffer_set (xfer_buffer, "key_bind_up", "/xfer up");
- weechat_buffer_set (xfer_buffer, "key_bind_down", "/xfer down");
- weechat_buffer_set (xfer_buffer, "localvar_set_type", "xfer");
+ weechat_hashtable_set (buffer_props, "type", "free");
+ weechat_hashtable_set (buffer_props, "title", _("Xfer list"));
+ weechat_hashtable_set (buffer_props, "key_bind_up", "/xfer up");
+ weechat_hashtable_set (buffer_props, "key_bind_down", "/xfer down");
+ weechat_hashtable_set (buffer_props, "localvar_set_type", "xfer");
}
+
+ xfer_buffer = weechat_buffer_new_props (
+ XFER_BUFFER_NAME,
+ buffer_props,
+ &xfer_buffer_input_cb, NULL, NULL,
+ &xfer_buffer_close_cb, NULL, NULL);
+
+ if (buffer_props)
+ weechat_hashtable_free (buffer_props);
}