aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/empathy-accounts-dialog.c158
-rw-r--r--src/empathy-accounts.c1
-rw-r--r--src/empathy-audio-sink.c26
-rw-r--r--src/empathy-audio-src.c55
-rw-r--r--src/empathy-auth-client.c2
-rw-r--r--src/empathy-av.c3
-rw-r--r--src/empathy-call-window.c18
-rw-r--r--src/empathy-call.c3
-rw-r--r--src/empathy-chat-window.c6
-rw-r--r--src/empathy-chat.c3
-rw-r--r--src/empathy-debugger.c1
-rw-r--r--src/empathy-invite-participant-dialog.c4
-rw-r--r--src/empathy-roster-window.c1
-rw-r--r--src/empathy-streamed-media-window.c18
-rw-r--r--src/empathy-video-widget.c14
-rw-r--r--src/empathy.c23
16 files changed, 136 insertions, 200 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 0e004f5a5..af85fd64f 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -40,7 +40,6 @@
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-connection-managers.h>
-#include <libempathy/empathy-connectivity.h>
#include <libempathy/empathy-pkg-kit.h>
#include <libempathy/empathy-tp-contact-factory.h>
@@ -97,6 +96,7 @@ typedef struct {
GtkWidget *enabled_switch;
GtkWidget *treeview;
+ GtkCellRenderer *name_renderer;
GtkWidget *button_add;
GtkWidget *button_remove;
@@ -133,7 +133,7 @@ typedef struct {
TpAccountManager *account_manager;
EmpathyConnectionManagers *cms;
- EmpathyConnectivity *connectivity;
+ GNetworkMonitor *connectivity;
GtkWindow *parent_window;
TpAccount *initial_selection;
@@ -463,7 +463,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
g_free (message);
}
- if (!empathy_connectivity_is_online (priv->connectivity))
+ if (!g_network_monitor_get_network_available (priv->connectivity))
accounts_dialog_status_infobar_set_message (dialog,
_("Offline — No Network Connection"));
@@ -1390,24 +1390,6 @@ accounts_dialog_button_remove_clicked_cb (GtkWidget *button,
accounts_dialog_remove_account_iter (dialog, &iter);
}
-#ifdef HAVE_MEEGO
-static void
-accounts_dialog_view_delete_activated_cb (EmpathyCellRendererActivatable *cell,
- const gchar *path_string,
- EmpathyAccountsDialog *dialog)
-{
- EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview));
- if (!gtk_tree_model_get_iter_from_string (model, &iter, path_string))
- return;
-
- accounts_dialog_remove_account_iter (dialog, &iter);
-}
-#endif /* HAVE_MEEGO */
-
static void
accounts_dialog_model_add_columns (EmpathyAccountsDialog *dialog)
{
@@ -1443,35 +1425,22 @@ accounts_dialog_model_add_columns (EmpathyAccountsDialog *dialog)
NULL);
/* Name renderer */
- cell = gtk_cell_renderer_text_new ();
- g_object_set (cell,
+ priv->name_renderer = gtk_cell_renderer_text_new ();
+ g_object_set (priv->name_renderer,
"ellipsize", PANGO_ELLIPSIZE_END,
"width-chars", 25,
"editable", TRUE,
NULL);
- gtk_tree_view_column_pack_start (column, cell, TRUE);
- gtk_tree_view_column_add_attribute (column, cell, "text", COL_NAME);
- g_signal_connect (cell, "edited",
+ gtk_tree_view_column_pack_start (column, priv->name_renderer, TRUE);
+ gtk_tree_view_column_add_attribute (column, priv->name_renderer,
+ "text", COL_NAME);
+ g_signal_connect (priv->name_renderer, "edited",
G_CALLBACK (accounts_dialog_name_edited_cb),
dialog);
- g_signal_connect (cell, "editing-started",
+ g_signal_connect (priv->name_renderer, "editing-started",
G_CALLBACK (accounts_dialog_name_editing_started_cb),
dialog);
- g_object_set (cell, "ypad", 4, NULL);
-
-#ifdef HAVE_MEEGO
- /* Delete column */
- cell = empathy_cell_renderer_activatable_new ();
- gtk_tree_view_column_pack_start (column, cell, FALSE);
- g_object_set (cell,
- "icon-name", GTK_STOCK_DELETE,
- "show-on-select", TRUE,
- NULL);
-
- g_signal_connect (cell, "path-activated",
- G_CALLBACK (accounts_dialog_view_delete_activated_cb),
- dialog);
-#endif /* HAVE_MEEGO */
+ g_object_set (priv->name_renderer, "ypad", 4, NULL);
}
static EmpathyAccountSettings *
@@ -1731,6 +1700,30 @@ accounts_dialog_treeview_enabled_cb (GtkMenuItem *item,
enable_and_connect_account (account, !enabled);
}
+static void
+accounts_dialog_treeview_rename_cb (GtkMenuItem *item,
+ EmpathyAccountsDialog *self)
+{
+ EmpathyAccountsDialogPriv *priv = GET_PRIV (self);
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview));
+ if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+ path = gtk_tree_model_get_path (model, &iter);
+
+ g_object_set (G_OBJECT (priv->name_renderer), "editable", TRUE, NULL);
+
+ gtk_widget_grab_focus (GTK_WIDGET (priv->treeview));
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->treeview), path,
+ gtk_tree_view_get_column (GTK_TREE_VIEW (priv->treeview), 0), TRUE);
+
+ gtk_tree_path_free (path);
+}
+
static gboolean
accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view,
GdkEventButton *event,
@@ -1742,8 +1735,7 @@ accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view,
GtkTreePath *path = NULL;
GtkTreeIter iter;
GtkWidget *menu;
- GtkWidget *item_enable, *item_disable;
- GtkWidget *image_enable, *image_disable;
+ GtkWidget *item;
/* ignore multiple clicks */
if (event->type != GDK_BUTTON_PRESS)
@@ -1766,49 +1758,37 @@ accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view,
/* Create the menu */
menu = empathy_context_menu_new (GTK_WIDGET (view));
- /* Get images for menu items */
- image_enable = gtk_image_new_from_icon_name (empathy_icon_name_for_presence (
- tp_account_manager_get_most_available_presence (
- priv->account_manager, NULL, NULL)),
- GTK_ICON_SIZE_MENU);
- image_disable = gtk_image_new_from_icon_name (
- empathy_icon_name_for_presence (TP_CONNECTION_PRESENCE_TYPE_OFFLINE),
- GTK_ICON_SIZE_MENU);
-
- /* Menu items: to enabled/disable the account */
- item_enable = gtk_image_menu_item_new_with_mnemonic (_("_Enable"));
- item_disable = gtk_image_menu_item_new_with_mnemonic (_("_Disable"));
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item_enable),
- image_enable);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item_disable),
- image_disable);
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item_enable);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item_disable);
+ /* Menu item: to enabled/disable the account */
+ item = gtk_check_menu_item_new_with_mnemonic (_("_Enabled"));
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
if (account_can_be_enabled (account))
{
- if (tp_account_is_enabled (account))
- {
- tp_g_signal_connect_object (item_disable, "activate",
- G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0);
- gtk_widget_set_sensitive (item_enable, FALSE);
- }
- else
- {
- tp_g_signal_connect_object (item_enable, "activate",
- G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0);
- gtk_widget_set_sensitive (item_disable, FALSE);
- }
+ gboolean active;
+
+ active = tp_account_is_enabled (account);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
+ active);
+
+ tp_g_signal_connect_object (item, "activate",
+ G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0);
}
else
{
- gtk_widget_set_sensitive (item_enable, FALSE);
- gtk_widget_set_sensitive (item_disable, FALSE);
+ gtk_widget_set_sensitive (item, FALSE);
}
- gtk_widget_show (item_enable);
- gtk_widget_show (item_disable);
+ gtk_widget_show (item);
+
+ /* Menu item: Rename */
+ item = gtk_menu_item_new_with_mnemonic (_("Rename"));
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+ tp_g_signal_connect_object (item, "activate",
+ G_CALLBACK (accounts_dialog_treeview_rename_cb), dialog, 0);
+
+ gtk_widget_show (item);
/* FIXME: Add here presence items, to be able to set per-account presence */
@@ -2467,11 +2447,6 @@ accounts_dialog_build_ui (EmpathyAccountsDialog *dialog)
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
-#ifdef HAVE_MEEGO
- gtk_widget_hide (action_area);
- gtk_widget_hide (priv->button_remove);
-#endif /* HAVE_MEEGO */
-
/* Display loading page */
priv->loading = TRUE;
@@ -2590,6 +2565,12 @@ do_dispose (GObject *obj)
priv->connecting_id = 0;
}
+ if (priv->connectivity)
+ {
+ g_object_unref (priv->connectivity);
+ priv->connectivity = NULL;
+ }
+
if (priv->account_manager != NULL)
{
g_object_unref (priv->account_manager);
@@ -2602,12 +2583,6 @@ do_dispose (GObject *obj)
priv->cms = NULL;
}
- if (priv->connectivity)
- {
- g_object_unref (priv->connectivity);
- priv->connectivity = NULL;
- }
-
if (priv->initial_selection != NULL)
{
g_object_unref (priv->initial_selection);
@@ -2675,7 +2650,8 @@ do_constructed (GObject *object)
tp_proxy_prepare_async (priv->account_manager, NULL,
accounts_dialog_manager_ready_cb, dialog);
- priv->connectivity = empathy_connectivity_dup_singleton ();
+ priv->connectivity = g_network_monitor_get_default ();
+ g_object_ref (priv->connectivity);
}
static void
diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c
index 6b51820f7..7b2964c4b 100644
--- a/src/empathy-accounts.c
+++ b/src/empathy-accounts.c
@@ -222,7 +222,6 @@ main (int argc, char *argv[])
GObjectClass *app_class;
gint retval;
- g_thread_init (NULL);
empathy_init ();
gtk_init (&argc, &argv);
diff --git a/src/empathy-audio-sink.c b/src/empathy-audio-sink.c
index 2968fb53c..d48e6af20 100644
--- a/src/empathy-audio-sink.c
+++ b/src/empathy-audio-sink.c
@@ -65,7 +65,7 @@ struct _EmpathyGstAudioSinkPrivate
gboolean echo_cancel;
gdouble volume;
gint volume_idle_id;
- GStaticMutex volume_mutex;
+ GMutex volume_mutex;
};
#define EMPATHY_GST_AUDIO_SINK_GET_PRIVATE(o) \
@@ -77,7 +77,7 @@ empathy_audio_sink_init (EmpathyGstAudioSink *self)
{
self->priv = EMPATHY_GST_AUDIO_SINK_GET_PRIVATE (self);
self->priv->echo_cancel = TRUE;
- g_static_mutex_init (&self->priv->volume_mutex);
+ g_mutex_init (&self->priv->volume_mutex);
}
static GstPad * empathy_audio_sink_request_new_pad (GstElement *self,
@@ -95,9 +95,9 @@ empathy_audio_sink_set_property (GObject *object,
switch (property_id)
{
case PROP_VOLUME:
- g_static_mutex_lock (&self->priv->volume_mutex);
+ g_mutex_lock (&self->priv->volume_mutex);
self->priv->volume = g_value_get_double (value);
- g_static_mutex_unlock (&self->priv->volume_mutex);
+ g_mutex_unlock (&self->priv->volume_mutex);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -129,7 +129,7 @@ empathy_audio_sink_dispose (GObject *object)
g_source_remove (priv->volume_idle_id);
priv->volume_idle_id = 0;
- g_static_mutex_free (&self->priv->volume_mutex);
+ g_mutex_clear (&self->priv->volume_mutex);
/* release any references held by the object here */
if (G_OBJECT_CLASS (empathy_audio_sink_parent_class)->dispose)
@@ -236,9 +236,9 @@ empathy_audio_sink_volume_idle_updated (gpointer user_data)
{
EmpathyGstAudioSink *self = EMPATHY_GST_AUDIO_SINK (user_data);
- g_static_mutex_lock (&self->priv->volume_mutex);
+ g_mutex_lock (&self->priv->volume_mutex);
self->priv->volume_idle_id = 0;
- g_static_mutex_unlock (&self->priv->volume_mutex);
+ g_mutex_unlock (&self->priv->volume_mutex);
g_object_notify (G_OBJECT (self), "volume");
@@ -253,7 +253,7 @@ empathy_audio_sink_volume_updated (GObject *object,
EmpathyGstAudioSink *self = EMPATHY_GST_AUDIO_SINK (user_data);
gdouble volume;
- g_static_mutex_lock (&self->priv->volume_mutex);
+ g_mutex_lock (&self->priv->volume_mutex);
g_object_get (object, "volume", &volume, NULL);
if (self->priv->volume == volume)
@@ -265,7 +265,7 @@ empathy_audio_sink_volume_updated (GObject *object,
empathy_audio_sink_volume_idle_updated, self);
out:
- g_static_mutex_unlock (&self->priv->volume_mutex);
+ g_mutex_unlock (&self->priv->volume_mutex);
}
static gboolean
@@ -274,9 +274,9 @@ empathy_audio_sink_volume_idle_setup (gpointer user_data)
EmpathyGstAudioSink *self = EMPATHY_GST_AUDIO_SINK (user_data);
gdouble volume;
- g_static_mutex_lock (&self->priv->volume_mutex);
+ g_mutex_lock (&self->priv->volume_mutex);
self->priv->volume_idle_id = 0;
- g_static_mutex_unlock (&self->priv->volume_mutex);
+ g_mutex_unlock (&self->priv->volume_mutex);
/* We can't do a bidirection bind as the ::notify comes from another
* thread, for other bits of empathy it's most simpler if it comes from
@@ -329,11 +329,11 @@ empathy_audio_sink_request_new_pad (GstElement *element,
if (GST_IS_STREAM_VOLUME (self->priv->sink))
{
- g_static_mutex_lock (&self->priv->volume_mutex);
+ g_mutex_lock (&self->priv->volume_mutex);
if (self->priv->volume_idle_id == 0)
self->priv->volume_idle_id = g_idle_add (
empathy_audio_sink_volume_idle_setup, self);
- g_static_mutex_unlock (&self->priv->volume_mutex);
+ g_mutex_unlock (&self->priv->volume_mutex);
}
else
{
diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c
index 9a882c146..590c65b66 100644
--- a/src/empathy-audio-src.c
+++ b/src/empathy-audio-src.c
@@ -77,7 +77,7 @@ struct _EmpathyGstAudioSrcPrivate
/* the mixer track on src we follow and adjust */
GstMixerTrack *track;
- GMutex *lock;
+ GMutex lock;
guint level_idle_id;
guint volume_idle_id;
};
@@ -93,7 +93,7 @@ struct _EmpathyGstAudioSrcPrivate
static void
empathy_audio_set_hw_mute (EmpathyGstAudioSrc *self, gboolean mute)
{
- g_mutex_lock (self->priv->lock);
+ g_mutex_lock (&self->priv->lock);
/* If there is no mixer available ignore the setting */
if (self->priv->track == NULL)
goto out;
@@ -101,7 +101,7 @@ empathy_audio_set_hw_mute (EmpathyGstAudioSrc *self, gboolean mute)
gst_mixer_set_mute (GST_MIXER (self->priv->src), self->priv->track, mute);
out:
- g_mutex_unlock (self->priv->lock);
+ g_mutex_unlock (&self->priv->lock);
self->priv->mute = mute;
}
@@ -110,13 +110,13 @@ empathy_audio_src_get_hw_mute (EmpathyGstAudioSrc *self)
{
gboolean result = self->priv->mute;
- g_mutex_lock (self->priv->lock);
+ g_mutex_lock (&self->priv->lock);
if (self->priv->track == NULL)
goto out;
result = GST_MIXER_TRACK_HAS_FLAG (self->priv->track, GST_MIXER_TRACK_MUTE);
out:
- g_mutex_unlock (self->priv->lock);
+ g_mutex_unlock (&self->priv->lock);
return result;
}
@@ -128,7 +128,7 @@ empathy_audio_src_set_hw_volume (EmpathyGstAudioSrc *self,
gint volumes[MAX_MIC_CHANNELS];
int i;
- g_mutex_lock (self->priv->lock);
+ g_mutex_lock (&self->priv->lock);
/* If there is no mixer available ignore the setting */
if (self->priv->track == NULL)
goto out;
@@ -140,7 +140,7 @@ empathy_audio_src_set_hw_volume (EmpathyGstAudioSrc *self,
self->priv->track, volumes);
out:
- g_mutex_unlock (self->priv->lock);
+ g_mutex_unlock (&self->priv->lock);
self->priv->volume = volume;
}
@@ -151,7 +151,7 @@ empathy_audio_src_get_hw_volume (EmpathyGstAudioSrc *self)
gint volumes[MAX_MIC_CHANNELS];
gdouble result = self->priv->volume;
- g_mutex_lock (self->priv->lock);
+ g_mutex_lock (&self->priv->lock);
if (self->priv->track == NULL)
goto out;
@@ -160,7 +160,7 @@ empathy_audio_src_get_hw_volume (EmpathyGstAudioSrc *self)
result = volumes[0]/(gdouble)self->priv->track->max_volume;
out:
- g_mutex_unlock (self->priv->lock);
+ g_mutex_unlock (&self->priv->lock);
return result;
}
@@ -347,7 +347,8 @@ empathy_audio_src_init (EmpathyGstAudioSrc *obj)
obj->priv = priv;
priv->peak_level = -G_MAXDOUBLE;
- priv->lock = g_mutex_new ();
+ g_mutex_init (&priv->lock);
+
priv->volume = 1.0;
priv->src = create_src ();
@@ -439,14 +440,14 @@ empathy_audio_src_get_property (GObject *object,
g_value_set_boolean (value, priv->mute);
break;
case PROP_PEAK_LEVEL:
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
g_value_set_double (value, priv->peak_level);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
break;
case PROP_RMS_LEVEL:
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
g_value_set_double (value, priv->rms_level);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
break;
case PROP_MICROPHONE:
g_value_set_uint (value, priv->source_idx);
@@ -552,7 +553,7 @@ empathy_audio_src_finalize (GObject *object)
EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
/* free any data held directly by the object here */
- g_mutex_free (priv->lock);
+ g_mutex_clear (&priv->lock);
G_OBJECT_CLASS (empathy_audio_src_parent_class)->finalize (object);
}
@@ -563,13 +564,13 @@ empathy_audio_src_levels_updated (gpointer user_data)
EmpathyGstAudioSrc *self = EMPATHY_GST_AUDIO_SRC (user_data);
EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
g_signal_emit (self, signals[PEAK_LEVEL_CHANGED], 0, priv->peak_level);
g_signal_emit (self, signals[RMS_LEVEL_CHANGED], 0, priv->rms_level);
priv->level_idle_id = 0;
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
return FALSE;
}
@@ -582,9 +583,9 @@ empathy_audio_src_volume_changed (gpointer user_data)
gdouble volume;
gboolean mute;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->volume_idle_id = 0;
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
volume = empathy_audio_src_get_hw_volume (self);
@@ -652,7 +653,7 @@ empathy_audio_src_handle_message (GstBin *bin, GstMessage *message)
rms = MAX (db, rms);
}
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->peak_level = peak;
priv->rms_level = rms;
@@ -660,7 +661,7 @@ empathy_audio_src_handle_message (GstBin *bin, GstMessage *message)
priv->level_idle_id = g_idle_add (
empathy_audio_src_levels_updated, self);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
else if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT &&
GST_MESSAGE_SRC (message) == GST_OBJECT (priv->src))
@@ -677,13 +678,13 @@ empathy_audio_src_handle_message (GstBin *bin, GstMessage *message)
GST_MIXER_MESSAGE_MUTE_TOGGLED)
gst_mixer_message_parse_mute_toggled (message, &track, NULL);
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
if (track != NULL && track == priv->track && priv->volume_idle_id == 0)
priv->volume_idle_id = g_idle_add (
empathy_audio_src_volume_changed, self);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
else if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STATE_CHANGED &&
GST_MESSAGE_SRC (message) == GST_OBJECT (priv->src))
@@ -699,18 +700,18 @@ empathy_audio_src_handle_message (GstBin *bin, GstMessage *message)
* Empathy. We want to pick up the level pulseaudio saved */
if (old == GST_STATE_NULL && new == GST_STATE_READY)
{
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->track = empathy_audio_src_get_track (priv->src);
if (priv->track != NULL)
priv->volume_idle_id = g_idle_add (
empathy_audio_src_volume_changed, self);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
else if (old == GST_STATE_READY && new == GST_STATE_NULL)
{
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->track = NULL;
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
}
diff --git a/src/empathy-auth-client.c b/src/empathy-auth-client.c
index ecf1ad173..ee33703fe 100644
--- a/src/empathy-auth-client.c
+++ b/src/empathy-auth-client.c
@@ -283,8 +283,6 @@ main (int argc,
TpSimpleClientFactory *tp_factory;
TpDBusDaemon *dbus;
- g_thread_init (NULL);
-
context = g_option_context_new (N_(" - Empathy authentication client"));
g_option_context_add_group (context, gtk_get_option_group (TRUE));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
diff --git a/src/empathy-av.c b/src/empathy-av.c
index 70acfc4f3..e65bef33b 100644
--- a/src/empathy-av.c
+++ b/src/empathy-av.c
@@ -112,9 +112,6 @@ main (int argc,
GError *error = NULL;
gint retval;
- /* Init */
- g_thread_init (NULL);
-
optcontext = g_option_context_new (N_("- Empathy Audio/Video Client"));
g_option_context_add_group (optcontext, gst_init_get_option_group ());
g_option_context_add_group (optcontext, gtk_get_option_group (TRUE));
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 3b05d4d7a..7ecac2806 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -242,7 +242,7 @@ struct _EmpathyCallWindowPriv
GTimer *timer;
guint timer_id;
- GMutex *lock;
+ GMutex lock;
gboolean call_started;
gboolean sending_video;
CameraState camera_state;
@@ -1638,7 +1638,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
g_signal_connect (priv->camera_monitor, "removed",
G_CALLBACK (empathy_call_window_camera_removed_cb), self);
- priv->lock = g_mutex_new ();
+ g_mutex_init (&priv->lock);
gtk_container_add (GTK_CONTAINER (self), top_vbox);
@@ -2371,7 +2371,7 @@ empathy_call_window_finalize (GObject *object)
disconnect_video_output_motion_handler (self);
/* free any data held directly by the object here */
- g_mutex_free (priv->lock);
+ g_mutex_clear (&priv->lock);
g_timer_destroy (priv->timer);
@@ -2544,7 +2544,7 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
if (could_reset_pipeline)
{
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
g_timer_stop (priv->timer);
@@ -2552,7 +2552,7 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
g_source_remove (priv->timer_id);
priv->timer_id = 0;
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
if (!restart)
/* We are about to destroy the window, no need to update it or create
@@ -3202,12 +3202,12 @@ empathy_call_window_state_changed_cb (EmpathyCallHandler *handler,
g_object_unref (call);
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->timer_id = g_timeout_add_seconds (1,
empathy_call_window_update_timer, self);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
empathy_call_window_update_timer (self);
@@ -3281,7 +3281,7 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
GstPad *pad;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
g_object_get (content, "media-type", &media_type, NULL);
@@ -3348,7 +3348,7 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
}
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
return TRUE;
}
diff --git a/src/empathy-call.c b/src/empathy-call.c
index 207f32f25..5c3633be5 100644
--- a/src/empathy-call.c
+++ b/src/empathy-call.c
@@ -186,9 +186,6 @@ main (int argc,
gint retval;
GtkSettings *gtk_settings;
- /* Init */
- g_thread_init (NULL);
-
#ifdef GDK_WINDOWING_X11
/* We can't call clutter_gst_init() before gtk_clutter_init(), so no choice
* but to intiialise X11 threading ourself */
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index ac3584f34..eb2e4b133 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -45,7 +45,6 @@
#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-tp-contact-factory.h>
-#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-request-util.h>
#include <libempathy/empathy-individual-manager.h>
@@ -1188,8 +1187,7 @@ chat_window_invite_participant_activate_cb (GtkAction *action,
contact = empathy_contact_dup_from_tp_contact (tp_contact);
- empathy_contact_list_add (EMPATHY_CONTACT_LIST (tp_chat),
- contact, _("Inviting you to this room"));
+ empathy_tp_chat_add (tp_chat, contact, _("Inviting you to this room"));
g_object_unref (contact);
}
@@ -2045,7 +2043,7 @@ drag_data_received_individual_id (EmpathyChatWindow *self,
tp_channel_get_identifier ((TpChannel *) chat));
contact = empathy_contact_dup_from_tp_contact (tp_contact);
- empathy_contact_list_add (EMPATHY_CONTACT_LIST (chat), contact, NULL);
+ empathy_tp_chat_add (chat, contact, NULL);
g_object_unref (contact);
out:
diff --git a/src/empathy-chat.c b/src/empathy-chat.c
index bebca4382..66ad346e7 100644
--- a/src/empathy-chat.c
+++ b/src/empathy-chat.c
@@ -103,9 +103,6 @@ main (int argc,
gint retval;
EmpathyIndividualManager *individual_mgr;
- /* Init */
- g_thread_init (NULL);
-
optcontext = g_option_context_new (N_("- Empathy Chat Client"));
g_option_context_add_group (optcontext, gtk_get_option_group (TRUE));
g_option_context_add_main_entries (optcontext, options, GETTEXT_PACKAGE);
diff --git a/src/empathy-debugger.c b/src/empathy-debugger.c
index 0bf34e015..c63a5b57b 100644
--- a/src/empathy-debugger.c
+++ b/src/empathy-debugger.c
@@ -101,7 +101,6 @@ main (int argc,
GtkApplication *app;
gint retval;
- g_thread_init (NULL);
gtk_init (&argc, &argv);
empathy_gtk_init ();
diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c
index fd5bd8f76..d92b531ea 100644
--- a/src/empathy-invite-participant-dialog.c
+++ b/src/empathy-invite-participant-dialog.c
@@ -17,7 +17,6 @@
#include "empathy-invite-participant-dialog.h"
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-contact-list.h>
#include <libempathy-gtk/empathy-contact-chooser.h>
#include <libempathy-gtk/empathy-individual-view.h>
@@ -146,8 +145,7 @@ filter_individual (EmpathyContactChooser *chooser,
return FALSE;
/* Filter out contacts which are already in the chat */
- members = empathy_contact_list_get_members (EMPATHY_CONTACT_LIST (
- self->priv->tp_chat));
+ members = empathy_tp_chat_get_members (self->priv->tp_chat);
for (l = members; l != NULL; l = g_list_next (l))
{
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index 203a5aede..a8eb40808 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -37,7 +37,6 @@
#include <libempathy/empathy-request-util.h>
#include <libempathy/empathy-chatroom-manager.h>
#include <libempathy/empathy-chatroom.h>
-#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-individual-manager.h>
#include <libempathy/empathy-gsettings.h>
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c
index deaae10d6..3bcb0e4f2 100644
--- a/src/empathy-streamed-media-window.c
+++ b/src/empathy-streamed-media-window.c
@@ -201,7 +201,7 @@ struct _EmpathyStreamedMediaWindowPriv
GtkWidget *video_brightness;
GtkWidget *video_gamma;
- GMutex *lock;
+ GMutex lock;
gboolean call_started;
gboolean sending_video;
CameraState camera_state;
@@ -1035,7 +1035,7 @@ empathy_streamed_media_window_init (EmpathyStreamedMediaWindow *self)
gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
- priv->lock = g_mutex_new ();
+ g_mutex_init (&priv->lock);
gtk_container_add (GTK_CONTAINER (self), top_vbox);
@@ -1727,7 +1727,7 @@ empathy_streamed_media_window_finalize (GObject *object)
disconnect_video_output_motion_handler (self);
/* free any data held directly by the object here */
- g_mutex_free (priv->lock);
+ g_mutex_clear (&priv->lock);
g_timer_destroy (priv->timer);
@@ -1870,7 +1870,7 @@ empathy_streamed_media_window_disconnected (EmpathyStreamedMediaWindow *self,
if (could_reset_pipeline)
{
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
g_timer_stop (priv->timer);
@@ -1878,7 +1878,7 @@ empathy_streamed_media_window_disconnected (EmpathyStreamedMediaWindow *self,
g_source_remove (priv->timer_id);
priv->timer_id = 0;
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
if (!restart)
/* We are about to destroy the window, no need to update it or create
@@ -2375,12 +2375,12 @@ empathy_streamed_media_window_connected (gpointer user_data)
g_object_unref (call);
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
priv->timer_id = g_timeout_add_seconds (1,
empathy_streamed_media_window_update_timer, self);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
empathy_streamed_media_window_update_timer (self);
@@ -2401,7 +2401,7 @@ empathy_streamed_media_window_src_added_cb (EmpathyStreamedMediaHandler *handler
GstPad *pad;
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
if (priv->call_state != CONNECTED)
{
@@ -2467,7 +2467,7 @@ empathy_streamed_media_window_src_added_cb (EmpathyStreamedMediaHandler *handler
}
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
return TRUE;
}
diff --git a/src/empathy-video-widget.c b/src/empathy-video-widget.c
index adca53ef6..9cf31d9c1 100644
--- a/src/empathy-video-widget.c
+++ b/src/empathy-video-widget.c
@@ -78,7 +78,7 @@ struct _EmpathyVideoWidgetPriv
gboolean flip_video;
guintptr xid;
- GMutex *lock;
+ GMutex lock;
};
#define GET_PRIV(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
@@ -90,7 +90,7 @@ empathy_video_widget_init (EmpathyVideoWidget *obj)
EmpathyVideoWidgetPriv *priv = GET_PRIV (obj);
GdkRGBA black;
- priv->lock = g_mutex_new ();
+ g_mutex_init (&priv->lock);
priv->notifier = fs_element_added_notifier_new ();
g_signal_connect (priv->notifier, "element-added",
@@ -367,7 +367,7 @@ empathy_video_widget_finalize (GObject *object)
EmpathyVideoWidgetPriv *priv = GET_PRIV (self);
/* free any data held directly by the object here */
- g_mutex_free (priv->lock);
+ g_mutex_clear (&priv->lock);
G_OBJECT_CLASS (empathy_video_widget_parent_class)->finalize (object);
}
@@ -400,9 +400,9 @@ empathy_video_widget_element_set_sink_properties (EmpathyVideoWidget *self)
{
EmpathyVideoWidgetPriv *priv = GET_PRIV (self);
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
empathy_video_widget_element_set_sink_properties_unlocked (self);
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
static void
@@ -412,7 +412,7 @@ empathy_video_widget_element_added_cb (FsElementAddedNotifier *notifier,
EmpathyVideoWidgetPriv *priv = GET_PRIV (self);
/* We assume the overlay is the sink */
- g_mutex_lock (priv->lock);
+ g_mutex_lock (&priv->lock);
if (priv->overlay == NULL && GST_IS_X_OVERLAY (element))
{
priv->overlay = element;
@@ -421,7 +421,7 @@ empathy_video_widget_element_added_cb (FsElementAddedNotifier *notifier,
empathy_video_widget_element_set_sink_properties_unlocked (self);
gst_x_overlay_expose (GST_X_OVERLAY (priv->overlay));
}
- g_mutex_unlock (priv->lock);
+ g_mutex_unlock (&priv->lock);
}
static void
diff --git a/src/empathy.c b/src/empathy.c
index b06b595e6..4db2cbb62 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -52,7 +52,6 @@
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-chatroom-manager.h>
#include <libempathy/empathy-account-settings.h>
-#include <libempathy/empathy-connectivity.h>
#include <libempathy/empathy-connection-managers.h>
#include <libempathy/empathy-request-util.h>
#include <libempathy/empathy-ft-factory.h>
@@ -119,7 +118,6 @@ struct _EmpathyApp
EmpathyChatroomManager *chatroom_manager;
EmpathyFTFactory *ft_factory;
EmpathyPresenceManager *presence_mgr;
- EmpathyConnectivity *connectivity;
GSettings *gsettings;
EmpathyNotificationsApprover *notifications_approver;
EmpathyConnectionAggregator *conn_aggregator;
@@ -157,7 +155,6 @@ empathy_app_dispose (GObject *object)
#endif
tp_clear_object (&self->presence_mgr);
- tp_clear_object (&self->connectivity);
tp_clear_object (&self->icon);
tp_clear_object (&self->account_manager);
tp_clear_object (&self->log_manager);
@@ -515,17 +512,6 @@ empathy_app_init (EmpathyApp *self)
}
static void
-use_conn_notify_cb (GSettings *gsettings,
- const gchar *key,
- gpointer user_data)
-{
- EmpathyConnectivity *connectivity = user_data;
-
- empathy_connectivity_set_use_conn (connectivity,
- g_settings_get_boolean (gsettings, key));
-}
-
-static void
migrate_config_to_xdg_dir (void)
{
gchar *xdg_dir, *old_dir, *xdg_filename, *old_filename;
@@ -766,14 +752,6 @@ empathy_app_constructed (GObject *object)
self->gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
- /* Setting up Connectivity */
- self->connectivity = empathy_connectivity_dup_singleton ();
- use_conn_notify_cb (self->gsettings, EMPATHY_PREFS_USE_CONN,
- self->connectivity);
- g_signal_connect (self->gsettings,
- "changed::" EMPATHY_PREFS_USE_CONN,
- G_CALLBACK (use_conn_notify_cb), self->connectivity);
-
/* account management */
self->account_manager = tp_account_manager_dup ();
tp_proxy_prepare_async (self->account_manager, NULL,
@@ -837,7 +815,6 @@ main (int argc, char *argv[])
EmpathyApp *app;
gint retval;
- g_thread_init (NULL);
g_type_init ();
#ifdef HAVE_LIBCHAMPLAIN