aboutsummaryrefslogtreecommitdiff
path: root/cmd-choose-tree.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-02-10 17:32:58 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-02-10 17:32:58 +0000
commit4d382ae8e6c71c5414dc41053223c05400d923f8 (patch)
tree7b2f3526edeec9fb799a1228df00bd3b34439675 /cmd-choose-tree.c
parent418ba99078a2712ece398e17a5a9bc1f6600126b (diff)
downloadrtmux-4d382ae8e6c71c5414dc41053223c05400d923f8.tar.gz
rtmux-4d382ae8e6c71c5414dc41053223c05400d923f8.tar.bz2
rtmux-4d382ae8e6c71c5414dc41053223c05400d923f8.zip
Miscellaneous tidying of choose API, including:
- rename client and session to start_client and start_session in window_choose_data struct. also add TREE_OTHER define and reorder the struct - rename window_choose_ctx to window_choose_data_run - don't pass a cmd_ctx into window_choose_create (will let it use a different client later). instead take type, session, client - add window_choose_data_free and use it to dispose of wcd rather than each cmd-*.c doing it individually - change so ref counting is done by wcd_add and wcd_free rather than callers. this means 1 ref for each item but what of it :-) - also add a ref to tree_session - not sure if this is needed? - all the callbacks except choose-client and find-window are the same so remove them and add window_choose_default_callback - reorder/rename some other bits and pieces for tidyness
Diffstat (limited to 'cmd-choose-tree.c')
-rw-r--r--cmd-choose-tree.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c
index cf0b772a..d3dfc7ff 100644
--- a/cmd-choose-tree.c
+++ b/cmd-choose-tree.c
@@ -34,9 +34,6 @@
enum cmd_retval cmd_choose_tree_exec(struct cmd *, struct cmd_ctx *);
-void cmd_choose_tree_callback(struct window_choose_data *);
-void cmd_choose_tree_free(struct window_choose_data *);
-
const struct cmd_entry cmd_choose_tree_entry = {
"choose-tree", NULL,
"S:W:swub:c:t:", 0, 1,
@@ -230,35 +227,10 @@ windows_only:
free(final_win_template_middle);
free(final_win_template_last);
- window_choose_ready(wl->window->active, cur_win,
- cmd_choose_tree_callback, cmd_choose_tree_free);
+ window_choose_ready(wl->window->active, cur_win, NULL, NULL);
if (args_has(args, 'u'))
window_choose_expand_all(wl->window->active);
return (CMD_RETURN_NORMAL);
}
-
-void
-cmd_choose_tree_callback(struct window_choose_data *cdata)
-{
- if (cdata == NULL)
- return;
-
- if (cdata->client->flags & CLIENT_DEAD)
- return;
-
- window_choose_ctx(cdata);
-}
-
-void
-cmd_choose_tree_free(struct window_choose_data *cdata)
-{
- cdata->session->references--;
- cdata->client->references--;
-
- free(cdata->ft_template);
- free(cdata->command);
- format_free(cdata->ft);
- free(cdata);
-}