static void
select_first_entity (TplActionChain *chain, gpointer user_data)
{
EmpathyLogWindow *self = user_data;
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeIter iter;
view = GTK_TREE_VIEW (self->priv->treeview_who);
model = gtk_tree_view_get_model (view);
selection = gtk_tree_view_get_selection (view);
if (gtk_tree_model_get_iter_first (model, &iter))
gtk_tree_selection_select_iter (selection, &iter);
_tpl_action_chain_continue (self->priv->chain);
}
static void
log_window_who_populate (EmpathyLogWindow *self)
{
EmpathyAccountChooser *account_chooser;
TpAccount *account;
gboolean all_accounts;
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkListStore *store;
Ctx *ctx;
if (self->priv->hits != NULL)
{
populate_entities_from_search_hits ();
return;
}
account_chooser = EMPATHY_ACCOUNT_CHOOSER (self->priv->account_chooser);
account = empathy_account_chooser_dup_account (account_chooser);
all_accounts = empathy_account_chooser_has_all_selected (account_chooser);
view = GTK_TREE_VIEW (self->priv->treeview_who);
model = gtk_tree_view_get_model (view);
selection = gtk_tree_view_get_selection (view);
store = GTK_LIST_STORE (model);
/* Block signals to stop the logs being retrieved prematurely */
g_signal_handlers_block_by_func (selection,
log_window_who_changed_cb,
self);
gtk_list_store_clear (store);
/* Unblock signals */
g_signal_handlers_unblock_by_func (selection,
log_window_who_changed_cb,
self);
_tpl_action_chain_clear (self->priv->chain);
self->priv->count++;
if (!all_accounts && account == NULL)
{
return;
}
else if (!all_accounts)
{
ctx = ctx_new (self, account, NULL, NULL, 0, 0, self->priv->count);
_tpl_action_chain_append (self->priv->chain, get_entities_for_account, ctx);
}
else
{
TpAccountManager *manager;
GList *accounts, *l;
manager = empathy_account_chooser_get_account_manager (account_chooser);
accounts = tp_account_manager_get_valid_accounts (manager);
for (l = accounts; l != NULL; l = l->next)
{
account = l->data;
ctx = ctx_new (self, account, NULL, NULL, 0, 0, self->priv->count);
_tpl_action_chain_append (self->priv->chain,
get_entities_for_account, ctx);
}
g_list_free (accounts);
}
_tpl_action_chain_append (self->priv->chain, select_first_entity, self);
_tpl_action_chain_start (self->priv->chain);
}
------------------------------------------------------------------------
@www.linuxidc.com:~/桌面/empathy-3.2.0$ grep TplLogManager -r ./
./libempathy-gtk/empathy-log-window.c: TplLogManager *manager = tpl_log_manager_dup_singleton ();
----------------------------
Telepathy Logger
It stores its logs to
${XDG_DATA_HOME}/share/TpLogger
which usually expands to at
${HOME}/.local/share/TpLogger/
See specs for more XDG_DATA_HOME details.