From fff5b192fd71a8c6c36c4061ddfa3f0470bd63a9 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 19 Apr 2005 01:09:33 +0000 Subject: [PATCH] more saving fixes --- processing/app/Sketch.java | 12 +++++++++--- processing/todo.txt | 21 +++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/processing/app/Sketch.java b/processing/app/Sketch.java index 2541460ae..daa5d8c58 100644 --- a/processing/app/Sketch.java +++ b/processing/app/Sketch.java @@ -752,7 +752,9 @@ public class Sketch { // if the new folder already exists, then need to remove // its contents before copying everything over // (user will have already been warned) - Base.removeDir(newFolder); + if (newFolder.exists()) { + Base.removeDir(newFolder); + } // in fact, you can't do this on windows because it tries // to go into the same folder, but it happens on osx a lot. @@ -774,7 +776,9 @@ public class Sketch { code[0].name = newName; // write the contents to the renamed file // (this may be resaved if the code is modified) - code[0].save(); + code[0].modified = true; + //code[0].save(); + //System.out.println("modified is " + modified); // change the other paths String oldName = name; @@ -1968,7 +1972,9 @@ public class Sketch { } else { // check to see if each modified code file can be written to for (int i = 0; i < codeCount; i++) { - if (code[i].modified && !code[i].file.canWrite()) { + if (code[i].modified && + !code[i].file.canWrite() && + code[i].file.exists()) { //System.err.println("found a read-only file " + code[i].file); return true; } diff --git a/processing/todo.txt b/processing/todo.txt index 05c1fc90f..3a45a9e43 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -30,6 +30,17 @@ first, it asks you if you want to save but mentions the pre-rename name. But I hit yes, quit, came back in, and all seemed right in the world. +X "save as" not actually saving properly +File>New +edit file... +File>Save As +File>Open some other file +File>Open original file +file is empty. +the only way to make File>Save As actually save new files, as far as i +can tell, is to Save As once, make at least one change, then Save. + + pending _ rename video.Camera to video.Video ? Capture ? _ VideoInput VideoOutput, SoundInput, SoundOutput or AudioInput/AudioOutput @@ -61,16 +72,6 @@ unhide "a_2" unhide "a" where did "a_2" go ? -(74) "save as" not actually saving properly -File>New -edit file... -File>Save As -File>Open some other file -File>Open original file -file is empty. -the only way to make File>Save As actually save new files, as far as i -can tell, is to Save As once, make at least one change, then Save. - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .