From e4f2234fffff40afa7f74dc33b5e0f8ad1a7d78f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Aug 2011 04:11:55 +0000 Subject: workaround [#28250] Append dialogue will ask to create new directory inside a .blend directory button isnt library aware, for now disable it when a libraries loaded. --- source/blender/editors/space_file/file_ops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index d4253495e97..4dd97c63d40 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1159,6 +1159,13 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused)) return OPERATOR_FINISHED; } +/* TODO, directory operator is non-functional while a library is loaded + * until this is properly supported just disable it. */ +static int file_directory_poll(bContext *C) +{ + return ED_operator_file_active(C) && filelist_lib(CTX_wm_space_file(C)->files) == NULL; +} + void FILE_OT_directory(struct wmOperatorType *ot) { /* identifiers */ @@ -1169,7 +1176,7 @@ void FILE_OT_directory(struct wmOperatorType *ot) /* api callbacks */ ot->invoke= file_directory_invoke; ot->exec= file_directory_exec; - ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ + ot->poll= file_directory_poll; /* <- important, handler is on window level */ } void FILE_OT_refresh(struct wmOperatorType *ot) -- cgit v1.2.3 From ae884d2e54210a8a1038c23cb7bdeaac16fdf2fb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Aug 2011 16:18:04 +0000 Subject: Code cleanup: add UNUSED_FUNCTION macro to avoid warning messages about unused functions. --- source/blender/editors/space_file/filelist.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 6736230e84f..d8be312cf39 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -602,28 +602,6 @@ short filelist_changed(struct FileList* filelist) return filelist->changed; } -static struct ImBuf * filelist_loadimage(struct FileList* filelist, int index) -{ - ImBuf *imb = NULL; - int fidx = 0; - - if ( (index < 0) || (index >= filelist->numfiltered) ) { - return NULL; - } - fidx = filelist->fidx[index]; - imb = filelist->filelist[fidx].image; - if (!imb) - { - if ( (filelist->filelist[fidx].flags & IMAGEFILE) || (filelist->filelist[fidx].flags & MOVIEFILE) ) { - imb = IMB_thumb_read(filelist->filelist[fidx].path, THB_NORMAL); - } - if (imb) { - filelist->filelist[fidx].image = imb; - } - } - return imb; -} - struct ImBuf * filelist_getimage(struct FileList* filelist, int index) { ImBuf* ibuf = NULL; -- cgit v1.2.3