[Bf-blender-cvs] [1e00e87] master: FileSpace selection didn't call op.check sometimes

Campbell Barton noreply at git.blender.org
Mon Feb 16 22:56:04 CET 2015


Commit: 1e00e87e3a312ecd98f582dfa6493bb088865085
Author: Campbell Barton
Date:   Tue Feb 17 08:52:19 2015 +1100
Branches: master
https://developer.blender.org/rB1e00e87e3a312ecd98f582dfa6493bb088865085

FileSpace selection didn't call op.check sometimes

(de)select all & globbing didnt run operators check callback.

D867 by @igel with edits

===================================================================

M	source/blender/editors/space_file/file_intern.h
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_file/filesel.c

===================================================================

diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 7425f2e..e7a6cd6 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -52,6 +52,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar);
 void file_calc_previews(const bContext *C, ARegion *ar);
 void file_draw_list(const bContext *C, ARegion *ar);
 
+void file_draw_check(bContext *C);
 void file_draw_check_cb(bContext *C, void *arg1, void *arg2);
 bool file_draw_check_exists(SpaceFile *sfile);
 
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 2a7e090..fe15863 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -237,7 +237,7 @@ static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select,
 	}
 
 	/* update operator for name change event */
-	file_draw_check_cb(C, NULL, NULL);
+	file_draw_check(C);
 	
 	return retval;
 }
@@ -436,6 +436,7 @@ static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
 		const FileCheckType check_type = (sfile->params->flag & FILE_DIRSEL_ONLY) ? CHECK_DIRS : CHECK_FILES;
 		filelist_select(sfile->files, &sel, FILE_SEL_ADD, FILE_SEL_SELECTED, check_type);
 	}
+	file_draw_check(C);
 	ED_area_tag_redraw(sa);
 	return OPERATOR_FINISHED;
 }
@@ -922,7 +923,7 @@ void file_operator_to_sfile(SpaceFile *sfile, wmOperator *op)
 	/* XXX, files and dirs updates missing, not really so important though */
 }
 
-void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
+void file_draw_check(bContext *C)
 {
 	SpaceFile *sfile = CTX_wm_space_file(C);
 	wmOperator *op = sfile->op;
@@ -942,6 +943,12 @@ void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
 	}
 }
 
+/* for use with; UI_block_func_set */
+void file_draw_check_cb(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
+{
+	file_draw_check(C);
+}
+
 bool file_draw_check_exists(SpaceFile *sfile)
 {
 	if (sfile->op) { /* fails on reload */
@@ -1519,6 +1526,9 @@ void file_filename_enter_handle(bContext *C, void *UNUSED(arg_unused), void *arg
 				}
 			}
 		}
+		else if (matches > 1) {
+			file_draw_check(C);
+		}
 	}
 }
 
@@ -1621,7 +1631,7 @@ static int file_filenum_exec(bContext *C, wmOperator *op)
 	if (sfile->params && (inc != 0)) {
 		BLI_newname(sfile->params->file, inc);
 		ED_area_tag_redraw(sa);
-		file_draw_check_cb(C, NULL, NULL);
+		file_draw_check(C);
 		// WM_event_add_notifier(C, NC_WINDOW, NULL);
 	}
 	
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 317573f..3b48af7 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -620,7 +620,7 @@ void ED_file_change_dir(bContext *C, const bool checkdir)
 
 		folderlist_pushdir(sfile->folders_prev, sfile->params->dir);
 
-		file_draw_check_cb(C, NULL, NULL);
+		file_draw_check(C);
 	}
 }




More information about the Bf-blender-cvs mailing list