From af48341439c36bc6ccaacde476c8d8315d08792d Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 17 Jul 2025 20:10:32 +0200 Subject: [PATCH] fix json project & workspace file paths when migrating from binary --- src/com/gpl/rpg/atcontentstudio/model/Project.java | 2 +- src/com/gpl/rpg/atcontentstudio/model/Workspace.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/model/Project.java b/src/com/gpl/rpg/atcontentstudio/model/Project.java index 9e10e9d..d9adcca 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/Project.java +++ b/src/com/gpl/rpg/atcontentstudio/model/Project.java @@ -241,9 +241,9 @@ public class Project implements ProjectTreeNode, Serializable, JsonSerializable return null; } else { p = (Project) SettingsSave.loadInstance(f, "Project"); + p.baseFolder = projRoot; } p.save(); - } p.refreshTransients(w); return p; diff --git a/src/com/gpl/rpg/atcontentstudio/model/Workspace.java b/src/com/gpl/rpg/atcontentstudio/model/Workspace.java index 3b7244c..2dcd0fb 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/Workspace.java +++ b/src/com/gpl/rpg/atcontentstudio/model/Workspace.java @@ -115,7 +115,7 @@ public class Workspace implements ProjectTreeNode, Serializable, JsonSerializabl w = loadWorkspaceFromJson(workspaceRoot, f2); w.refreshTransients(); } else { - Notification.addInfo("Could not find json workspace file. Falling back to binary"); + Notification.addInfo("Could not find json workspace file. Checking for binary file"); File f = new File(workspaceRoot, WS_SETTINGS_FILE); if (!workspaceRoot.exists() || !f.exists()) { w = new Workspace(workspaceRoot); @@ -123,10 +123,13 @@ public class Workspace implements ProjectTreeNode, Serializable, JsonSerializabl w = (Workspace) SettingsSave.loadInstance(f, "Workspace"); if (w == null) { w = new Workspace(workspaceRoot); - w.save(); } else { + w.settingsFile = f2; + w.baseFolder = workspaceRoot; + Notification.addInfo("Switched workspace to json format."); w.refreshTransients(); } + w.save(); } } activeWorkspace = w;