aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/drag_and_drop.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2011-09-28 20:58:56 +0000
committerGerald Combs <gerald@wireshark.org>2011-09-28 20:58:56 +0000
commit45859cc378646e7320281b74e4fae10b3bc29305 (patch)
tree2263c5fcb2623eb6a060075990f3ccc3c10f306a /gtk/drag_and_drop.c
parent1c4af9ad9c3845a07d4a067e2e9da316e345b9b4 (diff)
In drag_and_drop.c use accessor functions for GtkSelectionData. In
main_menubar.c use gtk_osxapplication_insert_app_menu_item instead of gtk_osxapplication_add_app_menu_item. Fixes deprecation-related errors when compiling with HAVE_GTKOSXAPPLICATION defined. svn path=/trunk/; revision=39180
Diffstat (limited to 'gtk/drag_and_drop.c')
-rw-r--r--gtk/drag_and_drop.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gtk/drag_and_drop.c b/gtk/drag_and_drop.c
index 7c0e334cb6..844ef5c75f 100644
--- a/gtk/drag_and_drop.c
+++ b/gtk/drag_and_drop.c
@@ -371,19 +371,20 @@ gboolean
gtk_osx_openFile (GtkOSXApplication *app _U_, gchar *path, gpointer user_data _U_)
{
GtkSelectionData selection_data;
- int length = strlen(path);
-
- selection_data.length = length + 3;
- selection_data.data = g_malloc(length + 3);
- memcpy(selection_data.data, path, length);
-
- selection_data.data[length] = '\r';
- selection_data.data[length + 1] = '\n';
- selection_data.data[length + 2] = '\0';
+ gchar *selection_path;
+ int length = strlen(path) + 3;
+
+ selection_path = g_malloc(length + 3);
+ memcpy(selection_path, path, length);
+
+ selection_path[length] = '\r';
+ selection_path[length + 1] = '\n';
+ selection_path[length + 2] = '\0';
+ gtk_selection_data_set_text(&selection_data, selection_path, length);
dnd_data_received(NULL, NULL, 0, 0, &selection_data, DND_TARGET_URL, 0, 0);
- g_free(selection_data.data);
+ g_free(selection_path);
return TRUE;
}