]> git.0d.be Git - empathy.git/blobdiff - src/empathy-mic-menu.c
update gnome-contacts's desktop file
[empathy.git] / src / empathy-mic-menu.c
index 7f5cd23809577357c171939f2318919ed25217ef..612ff34be7531762f4c59c3509acb323dcfd2dba 100644 (file)
  * Thanks guys!
  */
 
-#include <config.h>
-
-#include <gtk/gtk.h>
-
+#include "config.h"
 #include "empathy-mic-menu.h"
+
 #include "empathy-mic-monitor.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
 
 struct _EmpathyMicMenuPrivate
 {
@@ -372,6 +370,14 @@ empathy_mic_menu_constructed (GObject *obj)
   gtk_action_group_add_action (priv->action_group, priv->anchor_action);
   g_object_unref (priv->anchor_action);
 
+  priv->microphones = g_queue_new ();
+
+  /* Don't bother with any of this if we don't support changing
+   * microphone, so don't listen for microphone changes or enumerate
+   * the available microphones. */
+  if (!empathy_audio_src_supports_changing_mic (audio))
+    return;
+
   tp_g_signal_connect_object (audio, "notify::microphone",
       G_CALLBACK (empathy_mic_menu_notify_microphone_cb), self, 0);
   tp_g_signal_connect_object (priv->mic_monitor, "microphone-added",
@@ -379,8 +385,6 @@ empathy_mic_menu_constructed (GObject *obj)
   tp_g_signal_connect_object (priv->mic_monitor, "microphone-removed",
       G_CALLBACK (empathy_mic_menu_microphone_removed_cb), self, 0);
 
-  priv->microphones = g_queue_new ();
-
   empathy_mic_monitor_list_microphones_async (priv->mic_monitor,
       empathy_mic_menu_list_microphones_cb, self);
 }