for (acc = accounts, targ = targets;
acc != NULL && targ != NULL;
acc = acc->next, targ = targ->next)
{
TpAccount *account = acc->data;
TplEntity *target = targ->data;
if (tpl_log_manager_exists (self->priv->log_manager,
account, target, type))
{
/* And then we set it (and its subtypes, again, if any)
* as sensitive if there are logs of that type. */
log_window_update_what_iter_sensitivity (model, &iter, TRUE);
break;
}
}
}
g_list_free_full (accounts, g_object_unref);
g_list_free_full (targets, g_object_unref);
}
static void
log_window_who_changed_cb (GtkTreeSelection *selection,
EmpathyLogWindow *self)
{
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeIter iter;
DEBUG ("log_window_who_changed_cb");
view = gtk_tree_selection_get_tree_view (selection);
model = gtk_tree_view_get_model (view);
if (gtk_tree_model_get_iter_first (model, &iter))
{
/* If 'Anyone' is selected, everything else should be deselected */
if (gtk_tree_selection_iter_is_selected (selection, &iter))
{
g_signal_handlers_block_by_func (selection,
log_window_who_changed_cb,
self);
gtk_tree_selection_unselect_all (selection);
gtk_tree_selection_select_iter (selection, &iter);
g_signal_handlers_unblock_by_func (selection,
log_window_who_changed_cb,
self);
}
}
log_window_update_what_sensitivity (self);
log_window_update_buttons_sensitivity (self);
/* The contact changed, so the dates need to be updated */
log_window_chats_get_messages (self, TRUE);
}
static void
log_manager_got_entities_cb (GObject *manager,
GAsyncResult *result,
gpointer user_data)
{
Ctx *ctx = user_data;
GList *entities;
GList *l;
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkListStore *store;
GtkTreeIter iter;
GError *error = NULL;
gboolean select_account = FALSE;
if (log_window == NULL)
goto out;
if (log_window->priv->count != ctx->count)
goto out;