Wireshark-dev: [Wireshark-dev] More unused warnings in new menu code
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Sun, 24 Oct 2010 11:44:03 +0200
This patch should probably not be applied as is but intelligently because it contains stuff like: #ifndef BLA #ifdef BLA #else #endif #endif Ciao Jörg -- Joerg Mayer <jmayer@xxxxxxxxx> We are stuck with technology when what we really want is just stuff that works. Some say that should read Microsoft instead of technology.
Index: gtk/menus.c
===================================================================
--- gtk/menus.c (revision 34626)
+++ gtk/menus.c (working copy)
@@ -148,7 +148,9 @@
#define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
static void merge_all_tap_menus(GList *node);
+#ifndef MAIN_MENU_USE_UIMANAGER
static void clear_menu_recent_capture_file_cmd_cb(GtkWidget *w, gpointer unused _U_);
+#endif
#ifdef MAIN_MENU_USE_UIMANAGER
static void menu_open_recent_file_cmd_cb(GtkAction *action, gpointer data _U_ );
static void add_recent_items (guint merge_id, GtkUIManager *ui_manager);
@@ -4241,6 +4243,7 @@
+#ifndef MAIN_MENU_USE_UIMANAGER
static void
update_menu_recent_capture_file1(GtkWidget *widget, gpointer cnt) {
gchar *widget_cf_name;
@@ -4274,12 +4277,9 @@
}
/* make parent menu item sensitive only, if we have any valid files in the list */
-#ifdef MAIN_MENU_USE_UIMANAGER
- set_menu_sensitivity(ui_manager_main_menubar, MENU_RECENT_FILES_PATH, cnt);
-#else
set_menu_sensitivity_old(MENU_RECENT_FILES_PATH_OLD, cnt);
-#endif
}
+#endif
@@ -4327,7 +4327,6 @@
update_menu_recent_capture_file(submenu_recent_files);
}
-#endif
/* remove the capture filename from the "Recent Files" menu */
static void
@@ -4353,11 +4352,12 @@
will that free the label? */
gtk_container_remove(GTK_CONTAINER(submenu_recent_files), widget);
}
+#endif
#ifdef MAIN_MENU_USE_UIMANAGER
/* Add a file name to the top of the list, if its allrady present remove it first */
static GList *
-remove_present_file_name(GList *recent_files_list, const gchar *cf_name){
+remove_present_file_name(GList *recent_files_list, const gchar *cf_name _U_){
GList *li;
gchar *widget_cf_name;
@@ -4539,26 +4539,20 @@
FALSE);
}
-#endif /* MAIN_MENU_USE_UIMANAGER */
+#else
/* callback, if the user pushed the <Clear> menu item */
static void
clear_menu_recent_capture_file_cmd_cb(GtkWidget *w _U_, gpointer unused _U_) {
GtkWidget *submenu_recent_files;
-#ifdef MAIN_MENU_USE_UIMANAGER
- submenu_recent_files = gtk_ui_manager_get_widget(ui_manager_main_menubar, MENU_RECENT_FILES_PATH);
- if(!submenu_recent_files){
- g_warning("clear_menu_recent_capture_file_cmd_cb: No submenu_recent_files found, path= MENU_RECENT_FILES_PATH");
- }
-#else
submenu_recent_files = gtk_item_factory_get_widget(main_menu_factory, MENU_RECENT_FILES_PATH_OLD);
-#endif
gtk_container_foreach(GTK_CONTAINER(submenu_recent_files),
remove_menu_recent_capture_file, NULL);
update_menu_recent_capture_file(submenu_recent_files);
}
+#endif
/* Open a file by it's name
- Prev by Date: Re: [Wireshark-dev] I want to print the string tvb->real_data on the ubuntu terminal
- Next by Date: [Wireshark-dev] Wireshark or protocol bug? (HTTP MIME multipart)
- Previous by thread: Re: [Wireshark-dev] I want to print the string tvb->real_data on the ubuntu terminal
- Next by thread: [Wireshark-dev] Wireshark or protocol bug? (HTTP MIME multipart)
- Index(es):