Skip to content

Commit

Permalink
AS3: Fixed saving replacements. Version changed to alpha8
Browse files Browse the repository at this point in the history
  • Loading branch information
jindrapetrik committed Sep 19, 2010
1 parent c219403 commit 6f4754f
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions trunk/src/com/jpexs/asdec/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class Main {
public static String file;
public static String maskURL;
public static SWF swf;
public static final String version = "alpha7";
public static final String version = "alpha8";
public static String applicationName = "JP ActionScript Decompiler v." + version;
public static LoadingDialog loadingDialog = new LoadingDialog();
public static ModeFrame modeFrame;
Expand Down Expand Up @@ -89,15 +89,20 @@ private static String getReplacementsFile() {
* Saves replacements to file for future use
*/
public static void saveReplacements() {
try {
File f = new File(getASDecHome());
if (!f.exists()) f.mkdir();
PrintWriter pw = new PrintWriter(new FileWriter(getReplacementsFile()));
for (Replacement r : replacements) {
pw.println(r.urlPattern);
pw.println(r.targetFile);
try {
if(replacements.isEmpty()){
File rf=new File(getReplacementsFile());
if(rf.exists()) rf.delete();
}else{
File f = new File(getASDecHome());
if (!f.exists()) f.mkdir();
PrintWriter pw = new PrintWriter(new FileWriter(getReplacementsFile()));
for (Replacement r : replacements) {
pw.println(r.urlPattern);
pw.println(r.targetFile);
}
pw.close();
}
pw.close();
} catch (IOException e) {

}
Expand Down

0 comments on commit 6f4754f

Please sign in to comment.