char name[FILE_MAX];
area_prevspace(C);
- BLI_strncpy(name, sfile->params->dir, sizeof(name));
- strcat(name, sfile->params->file);
- RNA_string_set(sfile->op->ptr, "filename", name);
- sfile->op->type->exec(C, sfile->op);
- /* XXX for Ton: the call to WM_operator_free crashes
- WM_operator_free(sfile->op);
- sfile->op = NULL;
- */
+ if(sfile->op) {
+ wmOperator *op= sfile->op;
+
+ /* if load .blend, all UI pointers after exec are invalid! */
+ /* but, operator can be freed still */
+
+ sfile->op = NULL;
+ BLI_strncpy(name, sfile->params->dir, sizeof(name));
+ strcat(name, sfile->params->file);
+ RNA_string_set(op->ptr, "filename", name);
+
+ op->type->exec(C, op);
+
+ WM_operator_free(op);
+ }
+
}
break;
case B_FS_CANCEL:
static void file_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
+// SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
FileSelectParams* params = ED_fileselect_get_params(C);
View2D *v2d= &ar->v2d;
View2DScrollers *scrollers;
UI_view2d_view_restore(C);
}
-static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
-{
+//static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
+//{
/* context changes */
-}
+//}
/* only called once, from space/spacetypes.c */
void ED_spacetype_file(void)
ot->exec= wm_mainfile_exec;
ot->poll= WM_operator_winactive;
- ot->flag= OPTYPE_REGISTER;
+ ot->flag= 0;
RNA_def_property(ot->srna, "filename", PROP_STRING, PROP_FILEPATH);