[gtk+/gdk-backend: 85/91] Avoid unnecessary use of gdk conversion routines
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend: 85/91] Avoid unnecessary use of gdk conversion routines
- Date: Sat, 18 Dec 2010 01:12:58 +0000 (UTC)
commit 6e70791f235f3d653ec0ba8941f0be466d014bdd
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Dec 16 21:45:57 2010 -0500
Avoid unnecessary use of gdk conversion routines
We can use use gtk_selection_data_get_uris, instead of
manually doing the conversion ourselves.
gtk/gtkquartz.c | 23 +++++------------------
1 files changed, 5 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkquartz.c b/gtk/gtkquartz.c
index e894559..5b440e4 100644
--- a/gtk/gtkquartz.c
+++ b/gtk/gtkquartz.c
@@ -290,30 +290,17 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
}
else if ([type isEqualTo:NSURLPboardType])
{
- gchar **list = NULL;
- int count;
+ gchar **uris;
- count = gdk_text_property_to_utf8_list_for_display (display,
- gdk_atom_intern_static_string ("UTF8_STRING"),
- format,
- data,
- length,
- &list);
-
- if (count > 0)
+ uris = gtk_selection_data_get_uris (selection_data);
+ if (uris != NULL)
{
- gchar **result;
NSURL *url;
- result = g_uri_list_extract_uris (list[0]);
-
- url = [NSURL URLWithString:[NSString stringWithUTF8String:result[0]]];
+ url = [NSURL URLWithString:[NSString stringWithUTF8String:uris[0]]];
[url writeToPasteboard:pasteboard];
-
- g_strfreev (result);
}
-
- g_strfreev (list);
+ g_strfreev (uris);
}
else
[pasteboard setData:[NSData dataWithBytesNoCopy:(void *)data
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]