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
This commit is contained in:
Gerald Combs 2011-09-28 20:58:56 +00:00
parent 1c4af9ad9c
commit 45859cc378
2 changed files with 14 additions and 16 deletions

View File

@ -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;
}

View File

@ -3066,7 +3066,6 @@ main_menu_new(GtkAccelGroup ** table) {
#ifdef HAVE_GTKOSXAPPLICATION
GtkOSXApplication *theApp;
GtkWidget * item;
GtkOSXApplicationMenuGroup *group;
GtkWidget * dock_menu;
#endif
@ -3113,15 +3112,13 @@ main_menu_new(GtkAccelGroup ** table) {
gtk_osxapplication_set_menu_bar(theApp, GTK_MENU_SHELL(menubar));
gtk_osxapplication_set_use_quartz_accelerators(theApp, TRUE);
group = gtk_osxapplication_add_app_menu_group (theApp);
item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu/AboutWireshark");
gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
gtk_osxapplication_insert_app_menu_item(theApp, item, 0);
group = gtk_osxapplication_add_app_menu_group (theApp);
item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/EditMenu/Preferences");
gtk_osxapplication_add_app_menu_item(theApp, group,GTK_MENU_ITEM (item));
gtk_osxapplication_insert_app_menu_item(theApp, item, 0);
group = gtk_osxapplication_add_app_menu_group (theApp);
item = gtk_ui_manager_get_widget(ui_manager_main_menubar, "/Menubar/HelpMenu");
gtk_osxapplication_set_help_menu(theApp,GTK_MENU_ITEM(item));