svn path=/trunk/; revision=739
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-debug.h>
#include "empathy-avatar-chooser.h"
#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-avatar-chooser.h"
#include "empathy-conf.h"
#include "empathy-preferences.h"
if (!strcmp (target_type, URI_LIST_TYPE)) {
GFile *file;
GFileInputStream *input_stream;
if (!strcmp (target_type, URI_LIST_TYPE)) {
GFile *file;
GFileInputStream *input_stream;
gchar *nl;
gchar *data = NULL;
nl = strstr (selection_data->data, "\r\n");
if (nl) {
gchar *nl;
gchar *data = NULL;
nl = strstr (selection_data->data, "\r\n");
if (nl) {
uri = g_strndup (selection_data->data,
nl - (gchar*) selection_data->data);
uri = g_strndup (selection_data->data,
nl - (gchar*) selection_data->data);
+
+ file = g_file_new_for_uri (uri);
+ g_free (uri);
- uri = g_strdup (selection_data->data);
+ file = g_file_new_for_uri (selection_data->data);
-
- file = g_file_new_for_uri (uri);
input_stream = g_file_read (file, NULL, NULL);
if (input_stream != NULL) {
input_stream = g_file_read (file, NULL, NULL);
if (input_stream != NULL) {
bytes_read = g_input_stream_read (G_INPUT_STREAM (input_stream),
data, size,
NULL, NULL);
bytes_read = g_input_stream_read (G_INPUT_STREAM (input_stream),
data, size,
NULL, NULL);
if (bytes_read != -1) {
avatar_chooser_set_image_from_data (chooser,
data,
(gsize) bytes_read);
handled = TRUE;
if (bytes_read != -1) {
avatar_chooser_set_image_from_data (chooser,
data,
(gsize) bytes_read);
handled = TRUE;
- } else {
- g_free (data);
+
+ g_free (data);
+ g_object_unref (info);
- g_input_stream_close (G_INPUT_STREAM (input_stream), NULL, NULL);
+ g_object_unref (input_stream);
}
gtk_drag_finish (context, handled, FALSE, time);
}
gtk_drag_finish (context, handled, FALSE, time);