FileBrowser: Cleanup: rename some (really ugly) enum names.
This commit is contained in:
		@@ -220,7 +220,7 @@ static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select,
 | 
			
		||||
	const FileCheckType check_type = (sfile->params->flag & FILE_DIRSEL_ONLY) ? CHECK_DIRS : CHECK_ALL;
 | 
			
		||||
	
 | 
			
		||||
	/* flag the files as selected in the filelist */
 | 
			
		||||
	filelist_select(sfile->files, &sel, select, SELECTED_FILE, check_type);
 | 
			
		||||
	filelist_select(sfile->files, &sel, select, FILE_SEL_SELECTED, check_type);
 | 
			
		||||
	
 | 
			
		||||
	/* Don't act on multiple selected files */
 | 
			
		||||
	if (sel.first != sel.last) select = 0;
 | 
			
		||||
@@ -261,8 +261,8 @@ static int file_border_select_modal(bContext *C, wmOperator *op, const wmEvent *
 | 
			
		||||
		if ( (sel.first != params->sel_first) || (sel.last != params->sel_last) ) {
 | 
			
		||||
			int idx;
 | 
			
		||||
 | 
			
		||||
			file_deselect_all(sfile, HILITED_FILE);
 | 
			
		||||
			filelist_select(sfile->files, &sel, FILE_SEL_ADD, HILITED_FILE, CHECK_ALL);
 | 
			
		||||
			file_deselect_all(sfile, FILE_SEL_HIGHLIGHTED);
 | 
			
		||||
			filelist_select(sfile->files, &sel, FILE_SEL_ADD, FILE_SEL_HIGHLIGHTED, CHECK_ALL);
 | 
			
		||||
			WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
 | 
			
		||||
 | 
			
		||||
			/* dont highlight readonly file (".." or ".") on border select */
 | 
			
		||||
@@ -270,7 +270,7 @@ static int file_border_select_modal(bContext *C, wmOperator *op, const wmEvent *
 | 
			
		||||
				struct direntry *file = filelist_file(sfile->files, idx);
 | 
			
		||||
 | 
			
		||||
				if (STREQ(file->relname, "..") || STREQ(file->relname, ".")) {
 | 
			
		||||
					file->selflag &= ~HILITED_FILE;
 | 
			
		||||
					file->selflag &= ~FILE_SEL_HIGHLIGHTED;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				/* active_file gets highlighted as well - make sure it is no readonly file */
 | 
			
		||||
@@ -285,7 +285,7 @@ static int file_border_select_modal(bContext *C, wmOperator *op, const wmEvent *
 | 
			
		||||
	else {
 | 
			
		||||
		params->active_file = -1;
 | 
			
		||||
		params->sel_first = params->sel_last = -1;
 | 
			
		||||
		file_deselect_all(sfile, HILITED_FILE);
 | 
			
		||||
		file_deselect_all(sfile, FILE_SEL_HIGHLIGHTED);
 | 
			
		||||
		WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -305,7 +305,7 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
 | 
			
		||||
	if (!extend) {
 | 
			
		||||
		SpaceFile *sfile = CTX_wm_space_file(C);
 | 
			
		||||
 | 
			
		||||
		file_deselect_all(sfile, SELECTED_FILE);
 | 
			
		||||
		file_deselect_all(sfile, FILE_SEL_SELECTED);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	BLI_rcti_isect(&(ar->v2d.mask), &rect, &rect);
 | 
			
		||||
@@ -367,7 +367,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 | 
			
		||||
			}
 | 
			
		||||
			else {
 | 
			
		||||
				/* single select, deselect all selected first */
 | 
			
		||||
				if (!extend) file_deselect_all(sfile, SELECTED_FILE);
 | 
			
		||||
				if (!extend) file_deselect_all(sfile, FILE_SEL_SELECTED);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -427,11 +427,11 @@ static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
 | 
			
		||||
	}
 | 
			
		||||
	/* select all only if previously no file was selected */
 | 
			
		||||
	if (is_selected) {
 | 
			
		||||
		filelist_select(sfile->files, &sel, FILE_SEL_REMOVE, SELECTED_FILE, CHECK_ALL);
 | 
			
		||||
		filelist_select(sfile->files, &sel, FILE_SEL_REMOVE, FILE_SEL_SELECTED, CHECK_ALL);
 | 
			
		||||
	}
 | 
			
		||||
	else {
 | 
			
		||||
		const FileCheckType check_type = (sfile->params->flag & FILE_DIRSEL_ONLY) ? CHECK_DIRS : CHECK_FILES;
 | 
			
		||||
		filelist_select(sfile->files, &sel, FILE_SEL_ADD, SELECTED_FILE, check_type);
 | 
			
		||||
		filelist_select(sfile->files, &sel, FILE_SEL_ADD, FILE_SEL_SELECTED, check_type);
 | 
			
		||||
	}
 | 
			
		||||
	ED_area_tag_redraw(sa);
 | 
			
		||||
	return OPERATOR_FINISHED;
 | 
			
		||||
@@ -1510,7 +1510,7 @@ static int file_rename_exec(bContext *C, wmOperator *UNUSED(op))
 | 
			
		||||
		int numfiles = filelist_numfiles(sfile->files);
 | 
			
		||||
		if ( (0 <= idx) && (idx < numfiles) ) {
 | 
			
		||||
			struct direntry *file = filelist_file(sfile->files, idx);
 | 
			
		||||
			filelist_select_file(sfile->files, idx, FILE_SEL_ADD, EDITING_FILE, CHECK_ALL);
 | 
			
		||||
			filelist_select_file(sfile->files, idx, FILE_SEL_ADD, FILE_SEL_EDITING, CHECK_ALL);
 | 
			
		||||
			BLI_strncpy(sfile->params->renameedit, file->relname, FILE_MAXFILE);
 | 
			
		||||
			sfile->params->renamefile[0] = '\0';
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user