]> git.0d.be Git - empathy.git/commitdiff
Avoid potential segfaults if there are no contacts on the first pass.
authorTravis Reitter <treitter@gmail.com>
Tue, 22 Jun 2010 15:43:53 +0000 (08:43 -0700)
committerTravis Reitter <treitter@gmail.com>
Tue, 20 Jul 2010 23:12:35 +0000 (16:12 -0700)
configure.ac
libempathy-gtk/empathy-individual-menu.c
libempathy-gtk/empathy-individual-store.c

index dc849ebcdfd732b94e62c13a40e5a03569d199b4..17e0f5759901be5da1ff7745dff8e7bc9d842858 100644 (file)
@@ -140,31 +140,6 @@ AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-d
 
 AC_SUBST(ERROR_CFLAGS)
 
-# -----------------------------------------------------------
-# Enable TPL
-# -----------------------------------------------------------
-
-# It needs to be defined before PKG_CHECK_MODULES calls
-AC_ARG_ENABLE(tpl,
-  AC_HELP_STRING([--enable-tpl],[enable telepathy-logger code and disable the
-    empathy logger]), enable_tpl=$enableval, enable_tpl=no )
-AM_CONDITIONAL(ENABLE_TPL, test "x$enable_tpl" = "xyes")
-
-if test x${enable_tpl} = xyes; then
-  AC_DEFINE(ENABLE_TPL, [], [Enable TPL code])
-fi
-
-if test "x$enable_tpl" = "xyes"; then
-  PKG_CHECK_MODULES(TPL,
-  [
-     telepathy-logger = $TELEPATHY_LOGGER
-  ])
-  AC_SUBST(TPL_CFLAGS)
-  AC_SUBST(TPL_LIBS)
-fi
-
-
-
 # -----------------------------------------------------------
 # Pkg-Config dependency checks
 # -----------------------------------------------------------
index a849e7eb8392608cbec654c31c554a6835761461..98afbc5414df8630a6ec96b4ddaaf5e86af0d78e 100644 (file)
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
 #include <telepathy-glib/util.h>
-#ifdef ENABLE_TPL
 #include <telepathy-logger/log-manager.h>
-#else
 
-#include <libempathy/empathy-log-manager.h>
-#endif /* ENABLE_TPL */
 #include <libempathy/empathy-call-factory.h>
 #include <libempathy/empathy-dispatcher.h>
 #include <libempathy/empathy-contact-manager.h>
@@ -296,7 +292,8 @@ empathy_individual_audio_call_menu_item_activated (GtkMenuItem *item,
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
   factory = empathy_call_factory_get ();
-  empathy_call_factory_new_call_with_streams (factory, contact, TRUE, FALSE);
+  empathy_call_factory_new_call_with_streams (contact, TRUE, FALSE,
+      gtk_get_current_event_time (), NULL, NULL);
   g_object_unref (contact);
 }
 
@@ -340,7 +337,8 @@ empathy_individual_video_call_menu_item_activated (GtkMenuItem *item,
   g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
   factory = empathy_call_factory_get ();
-  empathy_call_factory_new_call_with_streams (factory, contact, TRUE, TRUE);
+  empathy_call_factory_new_call_with_streams (contact, TRUE, TRUE,
+      gtk_get_current_event_time (), NULL, NULL);
   g_object_unref (contact);
 }
 
@@ -389,11 +387,7 @@ individual_log_menu_item_activate_cb (FolksIndividual *individual)
 GtkWidget *
 empathy_individual_log_menu_item_new (FolksIndividual *individual)
 {
-#ifndef ENABLE_TPL
-  EmpathyLogManager *manager;
-#else
   TplLogManager *manager;
-#endif /* ENABLE_TPL */
   gboolean have_log;
   GtkWidget *item;
   GtkWidget *image;
@@ -405,17 +399,10 @@ empathy_individual_log_menu_item_new (FolksIndividual *individual)
 
   g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
 
-#ifndef ENABLE_TPL
-  manager = empathy_log_manager_dup_singleton ();
-  have_log = empathy_log_manager_exists (manager,
-      empathy_contact_get_account (contact), empathy_contact_get_id (contact),
-      FALSE);
-#else
   manager = tpl_log_manager_dup_singleton ();
   have_log = tpl_log_manager_exists (manager,
       empathy_contact_get_account (contact), empathy_contact_get_id (contact),
       FALSE);
-#endif /* ENABLE_TPL */
   g_object_unref (manager);
 
   item = gtk_image_menu_item_new_with_mnemonic (_("_Previous Conversations"));
@@ -505,7 +492,7 @@ empathy_individual_share_my_desktop_menu_item_new (FolksIndividual *individual)
   item = gtk_image_menu_item_new_with_mnemonic (_("Share My Desktop"));
   image = gtk_image_new_from_icon_name (GTK_STOCK_NETWORK, GTK_ICON_SIZE_MENU);
   gtk_widget_set_sensitive (item,
-      empathy_contact_can_use_stream_tube (contact));
+      empathy_contact_can_use_rfb_stream_tube (contact));
   gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
   gtk_widget_show (image);
 
index 3390f31df23eacf08e2f037729785310cbf058c7..1931106a4c4dac7f46bc71a68a03f13e1c00c519 100644 (file)
@@ -820,7 +820,7 @@ individual_store_manager_setup (gpointer user_data)
 {
   EmpathyIndividualStore *self = user_data;
   EmpathyIndividualStorePriv *priv = GET_PRIV (self);
-  GList *contacts;
+  GList *individuals;
 
   /* Signal connection. */
 
@@ -839,10 +839,13 @@ individual_store_manager_setup (gpointer user_data)
       G_CALLBACK (individual_store_groups_changed_cb), self);
 
   /* Add contacts already created. */
-  contacts = empathy_individual_manager_get_members (priv->manager);
-  individual_store_members_changed_cb (priv->manager, "initial add",
-      contacts, NULL, 0, self);
-  g_list_free (contacts);
+  individuals = empathy_individual_manager_get_members (priv->manager);
+  if (individuals != NULL && FOLKS_IS_INDIVIDUAL (individuals->data))
+    {
+      individual_store_members_changed_cb (priv->manager, "initial add",
+          individuals, NULL, 0, self);
+      g_list_free (individuals);
+    }
 
   priv->setup_idle_id = 0;
   return FALSE;