]> git.0d.be Git - empathy.git/blobdiff - src/empathy.c
include telepathy-glib.h
[empathy.git] / src / empathy.c
index 548a5e79f3c750b0073f54252c221828f868c2b1..fcfa0bc65e8a9e2d389e2dbc5eaf6716fd0bcb68 100644 (file)
 
 #include <libnotify/notify.h>
 
-#include <telepathy-glib/account-manager.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/debug-sender.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/connection-manager.h>
-#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/telepathy-glib.h>
 
 #include <telepathy-logger/telepathy-logger.h>
 
@@ -350,10 +345,17 @@ empathy_app_command_line (GApplication *app,
       self->activated = TRUE;
 
       /* Setting up UI */
-      self->window = empathy_roster_window_dup ();
+      self->window = empathy_roster_window_new (GTK_APPLICATION (app));
+      gtk_application_set_app_menu (GTK_APPLICATION (self),
+          empathy_roster_window_get_menu_model (
+            EMPATHY_ROSTER_WINDOW (self->window)));
 
       gtk_application_add_window (GTK_APPLICATION (app),
           GTK_WINDOW (self->window));
+      gtk_application_add_accelerator (GTK_APPLICATION (app),
+          "<Primary>h",
+          "win." EMPATHY_PREFS_UI_SHOW_OFFLINE,
+          NULL);
 
       /* check if Shell is running */
       dbus = tp_dbus_daemon_dup (&error);
@@ -702,7 +704,7 @@ account_manager_chatroom_ready_cb (GObject *source_object,
       return;
     }
 
-  accounts = tp_account_manager_get_valid_accounts (account_manager);
+  accounts = tp_account_manager_dup_valid_accounts (account_manager);
 
   for (l = accounts; l != NULL; l = g_list_next (l))
     {
@@ -715,7 +717,7 @@ account_manager_chatroom_ready_cb (GObject *source_object,
       tp_g_signal_connect_object (account, "notify::connection",
         G_CALLBACK (account_connection_changed_cb), chatroom_manager, 0);
     }
-  g_list_free (accounts);
+  g_list_free_full (accounts, g_object_unref);
 }
 
 static void
@@ -758,6 +760,8 @@ empathy_app_constructed (GObject *object)
   tp_proxy_prepare_async (self->account_manager, NULL,
       account_manager_ready_cb, self);
 
+  tp_account_manager_enable_restart (self->account_manager);
+
   migrate_config_to_xdg_dir ();
 
   /* Logging */