]> git.0d.be Git - empathy.git/commitdiff
Move empathy_check_available_state() from utils to sound-manager
authorXavier Claessens <xavier.claessens@collabora.co.uk>
Thu, 18 Jul 2013 10:31:49 +0000 (12:31 +0200)
committerXavier Claessens <xavier.claessens@collabora.co.uk>
Thu, 18 Jul 2013 11:02:17 +0000 (13:02 +0200)
It is used only from one place, there is no reason to have it
in utils.

https://bugzilla.gnome.org/show_bug.cgi?id=704454

libempathy-gtk/empathy-sound-manager.c
libempathy/empathy-utils.c
libempathy/empathy-utils.h

index 600816f67ed9bfbdf77ceed7a7db09fb75a92b96..4f69c62dbb0817094ebf67473e41be79700712da 100644 (file)
@@ -23,6 +23,7 @@
 #include <glib/gi18n-lib.h>
 
 #include "empathy-gsettings.h"
+#include "empathy-presence-manager.h"
 #include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
@@ -161,6 +162,23 @@ empathy_sound_manager_dup_singleton (void)
   return manager;
 }
 
+static gboolean
+empathy_check_available_state (void)
+{
+  TpConnectionPresenceType presence;
+  EmpathyPresenceManager *presence_mgr;
+
+  presence_mgr = empathy_presence_manager_dup_singleton ();
+  presence = empathy_presence_manager_get_state (presence_mgr);
+  g_object_unref (presence_mgr);
+
+  if (presence != TP_CONNECTION_PRESENCE_TYPE_AVAILABLE &&
+    presence != TP_CONNECTION_PRESENCE_TYPE_UNSET)
+    return FALSE;
+
+  return TRUE;
+}
+
 static gboolean
 empathy_sound_pref_is_enabled (EmpathySoundManager *self,
     EmpathySound sound_id)
index 0efe3a1807ebd959cbea8353fa7e38402a098ad7..25624bf002c17100b6e0be7103e21eaf5a4da972 100644 (file)
@@ -34,7 +34,6 @@
 #include <math.h>
 
 #include "empathy-client-factory.h"
-#include "empathy-presence-manager.h"
 #include "extensions.h"
 
 #include <math.h>
@@ -422,23 +421,6 @@ empathy_file_lookup (const gchar *filename, const gchar *subdir)
   return path;
 }
 
-gboolean
-empathy_check_available_state (void)
-{
-  TpConnectionPresenceType presence;
-  EmpathyPresenceManager *presence_mgr;
-
-  presence_mgr = empathy_presence_manager_dup_singleton ();
-  presence = empathy_presence_manager_get_state (presence_mgr);
-  g_object_unref (presence_mgr);
-
-  if (presence != TP_CONNECTION_PRESENCE_TYPE_AVAILABLE &&
-    presence != TP_CONNECTION_PRESENCE_TYPE_UNSET)
-    return FALSE;
-
-  return TRUE;
-}
-
 gint
 empathy_uint_compare (gconstpointer a,
     gconstpointer b)
index 440fe83504c406e7000a8a3d95cde3b572fd7cfb..f002c41cd25d618c994ddaeaef6913fcef0c7766 100644 (file)
@@ -60,7 +60,6 @@ const gchar * empathy_presence_to_str (TpConnectionPresenceType presence);
 TpConnectionPresenceType empathy_presence_from_str (const gchar *str);
 gchar * empathy_file_lookup (const gchar *filename,
     const gchar *subdir);
-gboolean empathy_check_available_state (void);
 gint empathy_uint_compare (gconstpointer a,
     gconstpointer b);