]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-presence-chooser.c
sort contacts by most recent event
[empathy.git] / libempathy-gtk / empathy-presence-chooser.c
index 08325d402e7a75880532d5b975ed77c08acb18ff..da08718cbd49d0bb88e1cb0f398a7669545b4be0 100644 (file)
  */
 
 #include "config.h"
-
-#include <string.h>
-#include <stdlib.h>
+#include "empathy-presence-chooser.h"
 
 #include <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
+#include <tp-account-widgets/tpaw-utils.h>
 
-#include <telepathy-glib/account-manager.h>
-#include <telepathy-glib/util.h>
-
-#include <libempathy/empathy-presence-manager.h>
-#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-status-presets.h>
+#include "empathy-presence-manager.h"
+#include "empathy-status-presets.h"
+#include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
 
 #include "empathy-ui-utils.h"
-#include "empathy-images.h"
 #include "empathy-presence-chooser.h"
 #include "empathy-status-preset-dialog.h"
 
@@ -280,7 +273,7 @@ get_state_and_status (EmpathyPresenceChooser *self,
 
        state = tp_account_manager_get_most_available_presence (
                priv->account_manager, NULL, &tmp);
-       if (EMP_STR_EMPTY (tmp)) {
+       if (TPAW_STR_EMPTY (tmp)) {
                /* no message, use the default message */
                g_free (tmp);
                tmp = g_strdup (empathy_presence_get_default_message (state));
@@ -759,7 +752,7 @@ update_sensitivity_am_prepared_cb (GObject *source_object,
                return;
        }
 
-       accounts = tp_account_manager_get_valid_accounts (manager);
+       accounts = tp_account_manager_dup_valid_accounts (manager);
 
        for (l = accounts ; l != NULL ; l = g_list_next (l)) {
                TpAccount *a = TP_ACCOUNT (l->data);
@@ -770,7 +763,7 @@ update_sensitivity_am_prepared_cb (GObject *source_object,
                }
        }
 
-       g_list_free (accounts);
+       g_list_free_full (accounts, g_object_unref);
 
        if (!g_network_monitor_get_network_available (priv->connectivity))
                sensitive = FALSE;
@@ -835,6 +828,9 @@ presence_chooser_constructed (GObject *object)
        GtkCellRenderer *renderer;
        const gchar *status_tooltip;
 
+       if (G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->constructed)
+               G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->constructed (object);
+
        presence_chooser_create_model (chooser);
 
        gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (chooser),