diff options
-rw-r--r-- | src/core/wee-command.c | 2 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-main.c | 2 | ||||
-rw-r--r-- | src/gui/gtk/gui-gtk-main.c | 2 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 4 | ||||
-rw-r--r-- | src/gui/gui-buffer.h | 3 | ||||
-rw-r--r-- | src/plugins/irc/irc-buffer.c | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.c | 2 | ||||
-rw-r--r-- | src/plugins/plugin.c | 2 | ||||
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua-api.c | 11 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 5 | ||||
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 7 | ||||
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby-api.c | 12 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.c | 5 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.h | 3 | ||||
-rw-r--r-- | src/plugins/scripts/script.c | 2 | ||||
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl-api.c | 15 | ||||
-rw-r--r-- | src/plugins/weechat-plugin.h | 6 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-buffer.c | 2 | ||||
-rw-r--r-- | src/plugins/xfer/xfer.c | 4 |
19 files changed, 34 insertions, 59 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index a04f306d7..a8b7a7523 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -595,7 +595,7 @@ command_buffer (void *data, struct t_gui_buffer *buffer, gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); return WEECHAT_RC_ERROR; } - gui_buffer_close (buffer, 1); + gui_buffer_close (buffer); gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); return WEECHAT_RC_OK; diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 986725e73..026f1289c 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -343,7 +343,7 @@ gui_main_end (int clean_exit) /* delete all buffers */ while (gui_buffers) { - gui_buffer_close (gui_buffers, 0); + gui_buffer_close (gui_buffers); } gui_ok = 0; diff --git a/src/gui/gtk/gui-gtk-main.c b/src/gui/gtk/gui-gtk-main.c index 89f7b74e1..8b12876aa 100644 --- a/src/gui/gtk/gui-gtk-main.c +++ b/src/gui/gtk/gui-gtk-main.c @@ -238,7 +238,7 @@ gui_main_end (int clean_exit) /* delete all buffers */ while (gui_buffers) { - gui_buffer_close (gui_buffers, 0); + gui_buffer_close (gui_buffers); } /* delete global history */ diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 22195097b..ba6c807b8 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1198,7 +1198,7 @@ gui_buffer_clear_all () */ void -gui_buffer_close (struct t_gui_buffer *buffer, int switch_to_another) +gui_buffer_close (struct t_gui_buffer *buffer) { struct t_gui_window *ptr_window; struct t_gui_buffer *ptr_buffer; @@ -1211,7 +1211,7 @@ gui_buffer_close (struct t_gui_buffer *buffer, int switch_to_another) (void)(buffer->close_callback) (buffer->close_callback_data, buffer); } - if (switch_to_another) + if (!weechat_quit) { for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window) diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h index 03c6806f6..ac40ee5aa 100644 --- a/src/gui/gui-buffer.h +++ b/src/gui/gui-buffer.h @@ -235,8 +235,7 @@ extern struct t_gui_window *gui_buffer_find_window (struct t_gui_buffer *buffer) extern int gui_buffer_is_scrolled (struct t_gui_buffer *buffer); extern void gui_buffer_clear (struct t_gui_buffer *buffer); extern void gui_buffer_clear_all (); -extern void gui_buffer_close (struct t_gui_buffer *buffer, - int switch_to_another); +extern void gui_buffer_close (struct t_gui_buffer *buffer); extern void gui_buffer_switch_previous (struct t_gui_window *window); extern void gui_buffer_switch_next (struct t_gui_window *window); extern void gui_buffer_switch_by_number (struct t_gui_window *window, diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c index cee9ade8b..efe2d4cb6 100644 --- a/src/plugins/irc/irc-buffer.c +++ b/src/plugins/irc/irc-buffer.c @@ -204,7 +204,7 @@ irc_buffer_merge_servers () { ptr_buffer = ptr_server->buffer; ptr_server->buffer = irc_buffer_servers; - weechat_buffer_close (ptr_buffer, 1); + weechat_buffer_close (ptr_buffer); } } } @@ -290,7 +290,7 @@ irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer) while (ptr_channel) { next_channel = ptr_channel->next_channel; - weechat_buffer_close (ptr_channel->buffer, 1); + weechat_buffer_close (ptr_channel->buffer); ptr_channel = next_channel; } irc_server_disconnect (ptr_server, 0); diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 033060285..70bc20588 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -2460,7 +2460,7 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc, } if (!ptr_channel->nicks) { - weechat_buffer_close (ptr_channel->buffer, 1); + weechat_buffer_close (ptr_channel->buffer); return WEECHAT_RC_OK; } channel_name = ptr_channel->name; diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index 7202e58db..fe305c3fd 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -700,7 +700,7 @@ plugin_remove (struct t_weechat_plugin *plugin) next_buffer = ptr_buffer->next_buffer; if (ptr_buffer->plugin == plugin) - gui_buffer_close (ptr_buffer, 1); + gui_buffer_close (ptr_buffer); ptr_buffer = next_buffer; } diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 30b6577d9..338f721d5 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -3797,7 +3797,7 @@ static int weechat_lua_api_buffer_close (lua_State *L) { const char *buffer; - int n, switch_to_another; + int n; /* make C compiler happy */ (void) L; @@ -3809,23 +3809,20 @@ weechat_lua_api_buffer_close (lua_State *L) } buffer = NULL; - switch_to_another = 0; n = lua_gettop (lua_current_interpreter); - if (n < 2) + if (n < 1) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); LUA_RETURN_ERROR; } - buffer = lua_tostring (lua_current_interpreter, -2); - switch_to_another = lua_tonumber (lua_current_interpreter, -1); + buffer = lua_tostring (lua_current_interpreter, -1); script_api_buffer_close (weechat_lua_plugin, lua_current_script, - script_str2ptr (buffer), - switch_to_another); + script_str2ptr (buffer)); LUA_RETURN_OK; } diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 5507136a1..0c01452b1 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -3223,7 +3223,7 @@ static XS (XS_weechat_api_buffer_close) PERL_RETURN_ERROR; } - if (items < 2) + if (items < 1) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); PERL_RETURN_ERROR; @@ -3231,8 +3231,7 @@ static XS (XS_weechat_api_buffer_close) script_api_buffer_close (weechat_perl_plugin, perl_current_script, - script_str2ptr (SvPV (ST (0), PL_na)), /* buffer */ - SvIV (ST (1))); /* switch_to_another */ + script_str2ptr (SvPV (ST (0), PL_na))); /* buffer */ PERL_RETURN_OK; } diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index ab629def6..e299255bc 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -3409,7 +3409,6 @@ static PyObject * weechat_python_api_buffer_close (PyObject *self, PyObject *args) { char *buffer; - int switch_to_another; /* make C compiler happy */ (void) self; @@ -3421,9 +3420,8 @@ weechat_python_api_buffer_close (PyObject *self, PyObject *args) } buffer = NULL; - switch_to_another = 0; - if (!PyArg_ParseTuple (args, "si", &buffer, &switch_to_another)) + if (!PyArg_ParseTuple (args, "s", &buffer)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); PYTHON_RETURN_ERROR; @@ -3431,8 +3429,7 @@ weechat_python_api_buffer_close (PyObject *self, PyObject *args) script_api_buffer_close (weechat_python_plugin, python_current_script, - script_str2ptr (buffer), - switch_to_another); + script_str2ptr (buffer)); PYTHON_RETURN_OK; } diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 2e1209e71..2d80aac8a 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -3895,11 +3895,9 @@ weechat_ruby_api_buffer_clear (VALUE class, VALUE buffer) */ static VALUE -weechat_ruby_api_buffer_close (VALUE class, VALUE buffer, - VALUE switch_to_another) +weechat_ruby_api_buffer_close (VALUE class, VALUE buffer) { char *c_buffer; - int c_switch_to_another; /* make C compiler happy */ (void) class; @@ -3911,24 +3909,20 @@ weechat_ruby_api_buffer_close (VALUE class, VALUE buffer, } c_buffer = NULL; - c_switch_to_another = 0; - if (NIL_P (buffer) || NIL_P (switch_to_another)) + if (NIL_P (buffer)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); RUBY_RETURN_ERROR; } Check_Type (buffer, T_STRING); - Check_Type (switch_to_another, T_FIXNUM); c_buffer = STR2CSTR (buffer); - c_switch_to_another = FIX2INT (switch_to_another); script_api_buffer_close (weechat_ruby_plugin, ruby_current_script, - script_str2ptr (c_buffer), - c_switch_to_another); + script_str2ptr (c_buffer)); RUBY_RETURN_OK; } diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index 40434ed62..25cdad711 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -1198,15 +1198,14 @@ script_api_buffer_new (struct t_weechat_plugin *weechat_plugin, void script_api_buffer_close (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - struct t_gui_buffer *buffer, - int switch_to_another) + struct t_gui_buffer *buffer) { struct t_script_callback *ptr_script_callback, *next_callback; if (!weechat_plugin || !script || !buffer) return; - weechat_buffer_close (buffer, switch_to_another); + weechat_buffer_close (buffer); ptr_script_callback = script->callbacks; while (ptr_script_callback) diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index a3dafe8af..c1a379d30 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -210,8 +210,7 @@ extern struct t_gui_buffer *script_api_buffer_new (struct t_weechat_plugin *weec const char *function_close); extern void script_api_buffer_close (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, - struct t_gui_buffer *buffer, - int switch_to_another); + struct t_gui_buffer *buffer); extern struct t_gui_bar_item *script_api_bar_item_new (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script, const char *name, diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index 9407456bc..9095bca28 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -486,7 +486,7 @@ script_remove (struct t_weechat_plugin *weechat_plugin, if (next_script_callback->buffer != ptr_script_callback->buffer) break; } - weechat_buffer_close (ptr_script_callback->buffer, 1); + weechat_buffer_close (ptr_script_callback->buffer); } ptr_script_callback = next_script_callback; diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 382d0b5f5..59b9448c5 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -3650,7 +3650,7 @@ weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *objp; - int i,switch_to_another; + int i; /* make C compiler happy */ (void) clientData; @@ -3661,22 +3661,15 @@ weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp, TCL_RETURN_ERROR; } - if (objc < 3) - { - WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); - TCL_RETURN_ERROR; - } - - if (Tcl_GetIntFromObj (interp, objv[2], &switch_to_another) != TCL_OK) + if (objc < 2) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("buffer_close"); TCL_RETURN_ERROR; } - + script_api_buffer_close (weechat_tcl_plugin, tcl_current_script, - script_str2ptr (Tcl_GetStringFromObj (objv[1], &i)), /* buffer */ - switch_to_another); /* switch_to_another */ + script_str2ptr (Tcl_GetStringFromObj (objv[1], &i))); /* buffer */ TCL_RETURN_OK; } diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 641310916..551d55321 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -433,7 +433,7 @@ struct t_weechat_plugin void *close_callback_data); struct t_gui_buffer *(*buffer_search) (const char *plugin, const char *name); void (*buffer_clear) (struct t_gui_buffer *buffer); - void (*buffer_close) (struct t_gui_buffer *buffer, int switch_to_another); + void (*buffer_close) (struct t_gui_buffer *buffer); int (*buffer_get_integer) (struct t_gui_buffer *buffer, const char *property); const char *(*buffer_get_string) (struct t_gui_buffer *buffer, @@ -934,8 +934,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->buffer_search(NULL, NULL) #define weechat_buffer_clear(__buffer) \ weechat_plugin->buffer_clear(__buffer) -#define weechat_buffer_close(__buffer, __switch_to_another) \ - weechat_plugin->buffer_close(__buffer, __switch_to_another) +#define weechat_buffer_close(__buffer) \ + weechat_plugin->buffer_close(__buffer) #define weechat_buffer_get_integer(__buffer, __property) \ weechat_plugin->buffer_get_integer(__buffer, __property) #define weechat_buffer_get_string(__buffer, __property) \ diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c index fbac50de6..6a3ba6db1 100644 --- a/src/plugins/xfer/xfer-buffer.c +++ b/src/plugins/xfer/xfer-buffer.c @@ -299,7 +299,7 @@ xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer, /* quit xfer buffer (close it) */ else if (weechat_strcasecmp (input_data, "q") == 0) { - weechat_buffer_close (buffer, 1); + weechat_buffer_close (buffer); } /* remove xfer */ else if (weechat_strcasecmp (input_data, "r") == 0) diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 14856c3d4..0c9e69694 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -609,9 +609,7 @@ xfer_free (struct t_xfer *xfer) return; if (xfer->buffer) - { - weechat_buffer_close (xfer->buffer, 1); - } + weechat_buffer_close (xfer->buffer); /* remove xfer from list */ if (last_xfer == xfer) |