changeset 419:ce5316d2e2d0

Cleanup last patch: - drop vd_pop_menu_dir_view_as_cb() since it is now unused. - use G_N_ELEMENTS()
author zas_
date Sat, 19 Apr 2008 11:11:53 +0000
parents 4043254aee5b
children 53cfc5af7fd7
files src/view_dir.c
diffstat 1 files changed, 3 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_dir.c	Sat Apr 19 09:49:14 2008 +0000
+++ b/src/view_dir.c	Sat Apr 19 11:11:53 2008 +0000
@@ -441,26 +441,11 @@
 	file_util_delete_dir(vd->click_fd, vd->widget);
 }
 
-static void vd_pop_menu_dir_view_as_cb(GtkWidget *widget, gpointer data)
-{
-	ViewDir *vd = data;
-	DirViewType new_type = DIRVIEW_LIST;
-
-	if (!vd->layout) return;
-
-	switch(vd->type)
-	{
-	case DIRVIEW_LIST: new_type = DIRVIEW_TREE; break;
-	case DIRVIEW_TREE: new_type = DIRVIEW_LIST; break;
-	}
-	
-	layout_views_set(vd->layout, new_type, vd->layout->icon_view);
-}
-
-#define VIEW_DIR_AS_SUBMENU_KEY "view_dir_as"
+#define VIEW_DIR_AS_SUBMENU_KEY "view_dir_as_submenu"
 static void vd_pop_submenu_dir_view_as_cb(GtkWidget *widget, gpointer data)
 {
 	ViewDir *vd = data;
+
 	DirViewType new_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), VIEW_DIR_AS_SUBMENU_KEY));
 	layout_views_set(vd->layout, new_type, vd->layout->icon_view);
 }
@@ -620,7 +605,7 @@
 	submenu = gtk_menu_new();
         gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
 
-	for (i = 0; i < sizeof(menu_view_dir_radio_entries) / sizeof(GtkRadioActionEntry); i++)
+	for (i = 0; i < G_N_ELEMENTS(menu_view_dir_radio_entries); i++)
 		{
 		item = menu_item_add_check(submenu, menu_view_dir_radio_entries[i].label,
 					   (vd->type == menu_view_dir_radio_entries[i].value),