2.5
[blender-staging.git] / source / blender / windowmanager / intern / wm_operators.c
index 9626fda6ffe2381468ecb2c57e22a71bd49c7744..3729365694f0ae32c02956b408a991600973cde5 100644 (file)
@@ -412,11 +412,16 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *even
 static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
 {
        char filename[FILE_MAX];
-       RNA_string_get(op->ptr, "filename", filename);
        
+       if(RNA_property_is_set(op->ptr, "filename"))
+               RNA_string_get(op->ptr, "filename", filename);
+       else {
+               BLI_strncpy(filename, G.sce, FILE_MAX);
+               untitled(filename);
+       }
        WM_write_file(C, filename, op->reports);
        
-       WM_event_add_notifier(C, NC_WINDOW, NULL);
+       WM_event_add_notifier(C, NC_WM|ND_FILESAVE, NULL);
 
        return 0;
 }