In drag_and_drop.c use accessor functions for GtkSelectionData. In
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 28 Sep 2011 20:58:56 +0000 (20:58 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 28 Sep 2011 20:58:56 +0000 (20:58 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39180 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/drag_and_drop.c
gtk/main_menubar.c

index 7c0e334cb6bd9501e7af9525b8be0818caa6ecc9..844ef5c75fee66cfe56fea2c2cb65aeeae6188d1 100644 (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;
 }
index 3d046515c64174a9f993d86157c3ec2f38e5cdff..b130aaf1ec40d0ced50b19a8da5d05cd42e73b14 100644 (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));