user to choose to display '.' directory in folder lists or not.
This option is saved to rc file as file_filter.show_dot_directory.
A minor fix was made to disable display of .. in folder selection
dialogs when current path is /.
options->thumbnails.fast = TRUE;
options->thumbnails.spec_standard = TRUE;
options->enable_metadata_dirs = FALSE;
+
options->file_filter.show_hidden_files = FALSE;
+ options->file_filter.show_dot_directory = FALSE;
options->file_filter.disable = FALSE;
if (buf && strlen(buf) > 0) options->file_ops.safe_delete_path = remove_trailing_slash(buf);
if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE;
+ if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE;
if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE;
if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE;
options->thumbnails.spec_standard = c_options->thumbnails.spec_standard;
options->enable_metadata_dirs = c_options->enable_metadata_dirs;
options->file_filter.show_hidden_files = c_options->file_filter.show_hidden_files;
+ options->file_filter.show_dot_directory = c_options->file_filter.show_dot_directory;
+
options->file_sort.case_sensitive = c_options->file_sort.case_sensitive;
options->file_filter.disable = c_options->file_filter.disable;
pref_checkbox_new_int(group, _("Show hidden files or folders"),
options->file_filter.show_hidden_files, &c_options->file_filter.show_hidden_files);
+ pref_checkbox_new_int(group, _("Show dot directory"),
+ options->file_filter.show_dot_directory, &c_options->file_filter.show_dot_directory);
pref_checkbox_new_int(group, _("Case sensitive sort"),
options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive);
WRITE_SUBTITLE("Filtering Options");
WRITE_BOOL(file_filter.show_hidden_files);
+ WRITE_BOOL(file_filter.show_dot_directory);
WRITE_BOOL(file_filter.disable);
WRITE_SEPARATOR();
/* filtering options */
READ_BOOL(file_filter.show_hidden_files);
+ READ_BOOL(file_filter.show_dot_directory);
READ_BOOL(file_filter.disable);
if (strcasecmp(option, "file_filter.ext") == 0)
/* file filtering */
struct {
gint show_hidden_files;
+ gint show_dot_directory;
gint disable;
} file_filter;
}
while ((dir = readdir(dp)) != NULL)
{
+ if (!options->file_filter.show_dot_directory
+ && dir->d_name[0] == '.' && dir->d_name[1] == '\0')
+ continue;
+ if (dir->d_name[0] == '.' && dir->d_name[1] == '.' && dir->d_name[2] == '\0'
+ && pathl[0] == '/' && pathl[1] == '\0')
+ continue; /* no .. for root directory */
if (dd->show_hidden || !is_hidden(dir->d_name))
{
gchar *name = dir->d_name;
vdl->list = g_list_prepend(vdl->list, fd);
g_free(filepath);
}
- filepath = g_strconcat(vdl->path, "/", ".", NULL);
- fd = file_data_new_simple(filepath);
- vdl->list = g_list_prepend(vdl->list, fd);
- g_free(filepath);
+
+ if (options->file_filter.show_dot_directory)
+ {
+ filepath = g_strconcat(vdl->path, "/", ".", NULL);
+ fd = file_data_new_simple(filepath);
+ vdl->list = g_list_prepend(vdl->list, fd);
+ g_free(filepath);
+ }
vdlist_populate(vdl);