comparison src/ui_pathsel.c @ 373:61a3c8b05b24

Add a new option in Preferences > Filtering to allow the 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 /.
author zas_
date Tue, 15 Apr 2008 20:36:11 +0000
parents 9995c5fb202a
children 4b2d7f9af171
comparison
equal deleted inserted replaced
372:8ce8d565c038 373:61a3c8b05b24
176 g_free(pathl); 176 g_free(pathl);
177 return; 177 return;
178 } 178 }
179 while ((dir = readdir(dp)) != NULL) 179 while ((dir = readdir(dp)) != NULL)
180 { 180 {
181 if (!options->file_filter.show_dot_directory
182 && dir->d_name[0] == '.' && dir->d_name[1] == '\0')
183 continue;
184 if (dir->d_name[0] == '.' && dir->d_name[1] == '.' && dir->d_name[2] == '\0'
185 && pathl[0] == '/' && pathl[1] == '\0')
186 continue; /* no .. for root directory */
181 if (dd->show_hidden || !is_hidden(dir->d_name)) 187 if (dd->show_hidden || !is_hidden(dir->d_name))
182 { 188 {
183 gchar *name = dir->d_name; 189 gchar *name = dir->d_name;
184 gchar *filepath = g_strconcat(pathl, "/", name, NULL); 190 gchar *filepath = g_strconcat(pathl, "/", name, NULL);
185 if (stat(filepath, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode)) 191 if (stat(filepath, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode))