devilhorns pushed a commit to branch master. http://git.enlightenment.org/apps/express.git/commit/?id=92eb062bc790f102d794992470d4f51ac1dc34ef
commit 92eb062bc790f102d794992470d4f51ac1dc34ef Author: Chris Michael <cp.mich...@samsung.com> Date: Mon Oct 26 15:37:56 2015 -0400 express: Reduce calls to treeview update Summary: If we assign the network to the channel earlier in the process, we can reduce calls to update the window treeview @fix Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- src/bin/callbacks.c | 8 ++++---- src/bin/window.c | 14 ++++++++------ src/bin/window.h | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/bin/callbacks.c b/src/bin/callbacks.c index 8d4a828..f9cc79f 100644 --- a/src/bin/callbacks.c +++ b/src/bin/callbacks.c @@ -321,8 +321,8 @@ _callback_user_join(Express_Network *net, const char *event EINA_UNUSED, const c const char *srv_name = NULL; srv_name = express_network_server_realname_get(srv); - if ((chl = _window_channel_create(channel, srv_name))) - _channel_network_set(chl, net); + chl = _window_channel_create(net, channel, srv_name); + if (!chl) return; } } @@ -357,8 +357,8 @@ _callback_user_private(Express_Network *net, const char *event EINA_UNUSED, cons const char *srv_name = NULL; srv_name = express_network_server_realname_get(srv); - if ((chl = _window_channel_create(source, srv_name))) - _channel_network_set(chl, net); + chl = _window_channel_create(net, source, srv_name); + if (!chl) return; } } diff --git a/src/bin/window.c b/src/bin/window.c index a4e2ebe..95451c9 100644 --- a/src/bin/window.c +++ b/src/bin/window.c @@ -391,7 +391,7 @@ _window_create(void) evas_object_show(_win->o_base); /* try to create a default channel */ - if ((chl = _window_channel_create("Status", NULL))) + if ((chl = _window_channel_create(NULL, "Status", NULL))) { /* swallow channel background */ _window_channel_swallow(chl); @@ -555,7 +555,7 @@ _window_size_update(void) } Channel * -_window_channel_create(const char *name, const char *server) +_window_channel_create(Express_Network *network, const char *name, const char *server) { Channel *chl; @@ -567,6 +567,8 @@ _window_channel_create(const char *name, const char *server) _channel_window_set(chl, _win->o_win); + _channel_network_set(chl, network); + /* force channel config update */ _channel_update(chl); @@ -881,7 +883,7 @@ _window_network_channels_create(Express_Network *net) continue; /* try to create a channel */ - if (!(chl = _window_channel_create(cfg_chl->name, srv_name))) + if (!(chl = _window_channel_create(net, cfg_chl->name, srv_name))) { express_network_channel_part(net, cfg_chl->name); continue; @@ -893,8 +895,6 @@ _window_network_channels_create(Express_Network *net) break; } - _window_treeview_update(); - /* if (i >= 0) */ /* { */ /* remove the default channel window @@ -942,7 +942,7 @@ _window_network_channels_destroy(Express_Network *net) Channel *chl; /* try to create a default channel */ - if ((chl = _window_channel_create("Status", NULL))) + if ((chl = _window_channel_create(NULL, "Status", NULL))) { /* swallow channel background */ _window_channel_swallow(chl); @@ -1030,6 +1030,8 @@ _window_tabcount_update(void) int n = 0, i = 0; double v1 = 0.0, v2 = 0.0; + if (!_ex_cfg->gui.tabs) return; + n = eina_list_count(_win->channels); if (n < 1) return; diff --git a/src/bin/window.h b/src/bin/window.h index eac6d83..2655340 100644 --- a/src/bin/window.h +++ b/src/bin/window.h @@ -6,7 +6,7 @@ Eina_Bool _window_destroy(void); void _window_update(void); void _window_size_update(void); -Channel *_window_channel_create(const char *name, const char *server); +Channel *_window_channel_create(Express_Network *network, const char *name, const char *server); void _window_channel_destroy(const char *name); Channel *_window_channel_find(const char *name); Channel *_window_channel_server_find(const char *server); --