2.5 file browser
authorAndrea Weikert <elubie@gmx.net>
Tue, 28 Jul 2009 18:20:16 +0000 (18:20 +0000)
committerAndrea Weikert <elubie@gmx.net>
Tue, 28 Jul 2009 18:20:16 +0000 (18:20 +0000)
* Bugfix: keep the filename when changing directory, either by clicking on it or by selecting a bookmark
* MSVC uninitialized variable runtime check fix in widget_draw_text

source/blender/editors/interface/interface_widgets.c
source/blender/editors/space_file/file_ops.c

index 485f8a2..cea3038 100644 (file)
@@ -780,7 +780,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
                
        /* text button selection and cursor */
        if(but->editstr && but->pos != -1) {
-               short t, pos, ch;
+               short t=0, pos=0, ch;
                short selsta_tmp, selend_tmp, selsta_draw, selwidth_draw;
                
                if ((but->selend - but->selsta) > 0) {
index c515ef6..65a46d6 100644 (file)
@@ -157,7 +157,6 @@ static FileSelect file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, s
                                        BLI_add_slash(params->dir);
                                }
 
-                               params->file[0] = '\0';
                                file_change_dir(sfile);
                                retval = FILE_SELECT_DIR;
                        }
@@ -322,7 +321,6 @@ static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
                BLI_strncpy(params->dir, entry, sizeof(params->dir));
                BLI_cleanup_dir(G.sce, params->dir);
                file_change_dir(sfile);                         
-               params->file[0] = '\0';
 
                WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
        }