File Browser: Two more minor fixes for arrow keys selection

* Unset active file on opening/resetting file list
* Accidentally placed NULL check in the middle of the function - not a
big deal as it's highly unlikely that it fails (removed it but added
assert)
This commit is contained in:
Julian Eisel 2015-06-12 06:25:43 +02:00
parent 2205950274
commit 7ca40c1061
2 changed files with 5 additions and 1 deletions

View File

@ -476,6 +476,8 @@ static bool file_walk_select_selection_set(
int active = active_old; /* could use active_old instead, just for readability */
bool deselect = false;
BLI_assert(params);
if (has_selection) {
if (extend &&
filelist_is_selected(files, active_old, FILE_SEL_SELECTED) &&
@ -512,7 +514,7 @@ static bool file_walk_select_selection_set(
}
}
if (!params || active < 0) {
if (active < 0) {
return false;
}

View File

@ -250,6 +250,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
/* operator has no setting for this */
params->sort = FILE_SORT_ALPHA;
params->active_file = -1;
/* initialize the list with previous folders */
@ -283,6 +284,7 @@ void ED_fileselect_reset_params(SpaceFile *sfile)
sfile->params->type = FILE_UNIX;
sfile->params->flag = 0;
sfile->params->title[0] = '\0';
sfile->params->active_file = -1;
}
int ED_fileselect_layout_numfiles(FileLayout *layout, ARegion *ar)