Commit f411b93c authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Don't crash when dragging from a source that doesn't support uri lists

2007-12-03  Richard Hult  <richard@imendio.com>

	* gtk/gtkquartz.c: (_gtk_quartz_set_selection_data_for_pasteboard):
	Don't crash when dragging from a source that doesn't support uri
	lists (bug #499868, Paul Davis).

svn path=/trunk/; revision=19102
parent 4a1478d6
2007-12-03 Richard Hult <richard@imendio.com>
* gtk/gtkquartz.c: (_gtk_quartz_set_selection_data_for_pasteboard):
Don't crash when dragging from a source that doesn't support uri
lists (bug #499868, Paul Davis).
2007-12-03 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c:
......
......@@ -220,7 +220,7 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
NSURL *url = [NSURL URLFromPasteboard:pasteboard];
selection_data->target = gdk_atom_intern_static_string ("text/uri-list");
uris[0] = (gchar *) [[url description] UTF8String];
uris[1] = NULL;
gtk_selection_data_set_uris (selection_data, uris);
......@@ -295,14 +295,16 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
&list);
if (count > 0)
result = g_uri_list_extract_uris (list[0]);
g_strfreev (list);
{
result = g_uri_list_extract_uris (list[0]);
url = [NSURL URLWithString:[NSString stringWithUTF8String:result[0]]];
[url writeToPasteboard:pasteboard];
url = [NSURL URLWithString:[NSString stringWithUTF8String:result[0]]];
[url writeToPasteboard:pasteboard];
g_strfreev (result);
g_strfreev (result);
}
g_strfreev (list);
}
else
[pasteboard setData:[NSData dataWithBytesNoCopy:selection_data->data
......@@ -310,5 +312,3 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
freeWhenDone:NO]
forType:type];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment