}
void
-empathy_builder_connect (GtkBuilder *gui,
- gpointer user_data,
- gchar *first_object,
+empathy_builder_connect (GtkBuilder *gui,
+ gpointer user_data,
+ const gchar *first_object,
...)
{
va_list args;
case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:
return EMPATHY_IMAGE_PENDING;
case TP_CONNECTION_PRESENCE_TYPE_UNSET:
+ default:
return NULL;
}
FolksPresenceType folks_presence;
TpConnectionPresenceType presence;
- folks_presence = folks_individual_get_presence_type (individual);
+ folks_presence =
+ folks_presence_get_presence_type (FOLKS_PRESENCE (individual));
presence = empathy_folks_presence_type_to_tp (folks_presence);
return empathy_icon_name_for_presence (presence);
{
GFile *file = G_FILE (object);
PixbufAvatarFromIndividualClosure *closure = user_data;
- char *data;
+ char *data = NULL;
gsize data_size;
struct SizeData size_data;
GError *error = NULL;
}
g_simple_async_result_set_op_res_gpointer (closure->result,
- avatar_pixbuf_from_loader (loader), NULL);
+ avatar_pixbuf_from_loader (loader), g_object_unref);
out:
g_simple_async_result_complete (closure->result);
void
empathy_pixbuf_avatar_from_individual_scaled_async (
FolksIndividual *individual,
- GAsyncReadyCallback callback,
gint width,
gint height,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
gpointer user_data)
{
GFile *avatar_file;
result = g_simple_async_result_new (G_OBJECT (individual),
callback, user_data,
- empathy_pixbuf_avatar_from_individual_scaled_finish);
+ empathy_pixbuf_avatar_from_individual_scaled_async);
avatar_file = folks_avatar_get_avatar (FOLKS_AVATAR (individual));
if (avatar_file == NULL)
if (closure == NULL)
goto out;
- g_file_load_contents_async (avatar_file, NULL,
+ g_file_load_contents_async (avatar_file, cancellable,
avatar_file_load_contents_cb, closure);
g_object_unref (result);
g_object_unref (result);
}
+/* Return a ref on the GdkPixbuf */
GdkPixbuf *
empathy_pixbuf_avatar_from_individual_scaled_finish (
FolksIndividual *individual,
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
gboolean result_valid;
+ GdkPixbuf *pixbuf;
g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (simple), NULL);
result_valid = g_simple_async_result_is_valid (result,
G_OBJECT (individual),
- empathy_pixbuf_avatar_from_individual_scaled_finish);
+ empathy_pixbuf_avatar_from_individual_scaled_async);
g_return_val_if_fail (result_valid, NULL);
- return g_simple_async_result_get_op_res_gpointer (simple);
+ pixbuf = g_simple_async_result_get_op_res_gpointer (simple);
+ return pixbuf != NULL ? g_object_ref (pixbuf) : NULL;
}
GdkPixbuf *
gtk_status_icon_get_geometry (status_icon, NULL, &icon_location, NULL);
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- dpy = gdk_x11_drawable_get_xdisplay (gdk_window);
+ dpy = GDK_WINDOW_XDISPLAY (gdk_window);
data[0] = icon_location.x;
data[1] = icon_location.y;
XChangeProperty (dpy,
GDK_WINDOW_XID (gdk_window),
gdk_x11_get_xatom_by_name_for_display (
- gdk_drawable_get_display (gdk_window),
+ gdk_window_get_display (gdk_window),
"_NET_WM_ICON_GEOMETRY"),
XA_CARDINAL, 32, PropModeReplace,
(guchar *)&data, 4);
gtk_widget_hide (GTK_WIDGET (window));
}
- gtk_window_present_with_time (window, timestamp);
+ if (timestamp == GDK_CURRENT_TIME)
+ gtk_window_present (window);
+ else
+ gtk_window_present_with_time (window, timestamp);
+
gtk_window_set_skip_taskbar_hint (window, FALSE);
gtk_window_deiconify (window);
}
void
empathy_window_present (GtkWindow *window)
{
- empathy_window_present_with_time (window, GDK_CURRENT_TIME);
+ empathy_window_present_with_time (window, gtk_get_current_event_time ());
}
GtkWindow *
g_assert (contact != NULL);
title = g_strdup_printf (_("Incoming file from %s"),
- empathy_contact_get_name (contact));
+ empathy_contact_get_alias (contact));
widget = gtk_file_chooser_dialog_new (title,
NULL,