[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] [PATCH] Show Hidden Files Option in File Selector



Attached is a small patch to add an option to show hidden files in the
files selector.

metrics


Index: src/bin/e_fm.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.70
diff -r1.70 e_fm.c
60a61
>    unsigned char     show_hidden_files : 1;
202a204
> static void _e_fm2_toggle_hidden_files(void *data, E_Menu *m, E_Menu_Item *mi);
236a239
> 
3193c3196
< 	/* no - you don't want the cuirrent and parent dir links listed */
---
> 	/* no - you don't want the current and parent dir links listed */
3195,3196c3198,3199
< 	/* skip dotfiles */
< 	if (dp->d_name[0] == '.') return 1;
---
> 	/* skip dotfiles if we're not showing hidden files */
> 	if (dp->d_name[0] == '.' && !sd->show_hidden_files) return 1;
3513a3517,3526
>    mi = e_menu_item_new(mn);
>    e_menu_item_label_set(mi, _("Show Hidden Files"));
>    e_menu_item_icon_edje_set(mi,
> 			     e_theme_edje_file_get("base/theme/fileman",
> 						   "e/fileman/button/hidden_files"),
> 			     "e/fileman/button/hidden_files");
>    e_menu_item_check_set(mi, 1);
>    e_menu_item_toggle_set(mi, sd->show_hidden_files);
>    e_menu_item_callback_set(mi, _e_fm2_toggle_hidden_files, sd);
> 
3594a3608,3617
>    mi = e_menu_item_new(mn);
>    e_menu_item_label_set(mi, _("Show Hidden Files"));
>    e_menu_item_icon_edje_set(mi,
> 			     e_theme_edje_file_get("base/theme/fileman",
> 						   "e/fileman/button/hidden_files"),
> 			     "e/fileman/button/hidden_files");
>    e_menu_item_check_set(mi, 1);
>    e_menu_item_toggle_set(mi, sd->show_hidden_files);
>    e_menu_item_callback_set(mi, _e_fm2_toggle_hidden_files, sd);
> 
3721a3745,3758
> _e_fm2_toggle_hidden_files(void *data, E_Menu *m, E_Menu_Item *mi)
> {
>    E_Fm2_Smart_Data *sd;
>    
>    sd = data;
>    if (sd->show_hidden_files)
>      sd->show_hidden_files = 0;
>    else
>      sd->show_hidden_files = 1;
> 
>    _e_fm2_refresh(data, m, mi);
> }
> 
> static void