Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-02-16 17:48:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-02-16 17:58:57 +0300
commit0dfdca6d132dd0b26307ab0c35be87f78da98022 (patch)
treeafd84c26a68b34e6b9b160bfe28a283d8ae45b1a /source/blender/makesrna
parentfd4f0ed39e7b6482218af59f69187525d565ecf0 (diff)
Fix T43684: File Browser is unusable on Windows Machines (do not BLI_is_dir() in draw loop!)
Did not had any issue on linux, but looks like on some windows can slow things as Hell. Or maybe just the presence of some network FS? Anyway, not a good idea, so now fsmenu entries' valid status is stored and only evaluated on startup (reading of bookmarks & co) and when opening file browser (refresh, like for system bookmarks).
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_space.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index ef5a6c2a51c..13ec2ddf523 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1423,13 +1423,6 @@ static int rna_FileBrowser_FSMenuEntry_name_get_editable(PointerRNA *ptr)
return fsm->save;
}
-static int rna_FileBrowser_FSMenuEntry_is_valid_get(PointerRNA *ptr)
-{
- char *path = ED_fsmenu_entry_get_path(ptr->data);
-
- return path ? BLI_is_dir(path) : false; /* For now, no path = invalid. */
-}
-
static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal = &iter->internal.listbase;
@@ -3638,8 +3631,8 @@ static void rna_def_filemenu_entry(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_is_valid_get", NULL);
- RNA_def_property_ui_text(prop, "Save", "Whether this path is saved in bookmarks, or generated from OS");
+ RNA_def_property_boolean_sdna(prop, NULL, "valid", 1);
+ RNA_def_property_ui_text(prop, "Valid", "Whether this path is currently reachable");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
}