Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-28 20:46:14 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-28 20:46:14 +0400
commitaa44603146e87f29f08cee2abab7e0ddd89222c5 (patch)
treedf7c7a0f0ecec9317c0350584a83644d9517c40c /source/blender/blenlib
parent74e4ad20c9e8d19f85aaa2995652e3f65bdfc0c9 (diff)
2.5: File browser
* Side panels now use list widgets. * Enabled theme colors for side panel. * Add button in bookmarks panel. * Operator panel title now uses operator name. * For unix, added / to system, and home and desktop to bookmarks. * For opening fileselect with filter, cleaned up the code a bit, adding WM_operator_properties_filesel instead of duplicating code. * Also added filter for all operators calling fileselect, only image and file open did it before. * Hide . files by default, and also hide files ending with ~. * Added back .. (but not .) in the file list, I really missed this. * File highlight now only happens when you're actually over a file, instead staying after you move the mouse away. * Fix some redraw/refresh issues.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/storage.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 817209eaed4..0a416e624cb 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -218,7 +218,7 @@ void BLI_builddir(char *dirname, char *relname)
{
struct dirent *fname;
struct dirlink *dlink;
- int rellen, newnum = 0;
+ int rellen, newnum = 0, len;
char buf[256];
DIR *dir;
@@ -237,13 +237,11 @@ void BLI_builddir(char *dirname, char *relname)
if ( (dir = (DIR *)opendir(".")) ){
while ((fname = (struct dirent*) readdir(dir)) != NULL) {
+ len= strlen(fname->d_name);
- if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0) {
- }
- else if ( ( (fname->d_name[0] == '.') && (fname->d_name[1] == 0) ) ||
- ( (fname->d_name[0] == '.') && (fname->d_name[1] == '.') && (fname->d_name[2] == 0)) ) {
- /* ignore '.' and '..' */
- }
+ if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0); /* ignore .file */
+ else if(hide_dot && len && fname->d_name[len-1]=='~'); /* ignore file~ */
+ else if (((fname->d_name[0] == '.') && (fname->d_name[1] == 0) )); /* ignore . */
else {
dlink = (struct dirlink *)malloc(sizeof(struct dirlink));
if (dlink){