mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-02-23 15:38:23 +01:00
fix json project & workspace file paths when migrating from binary
This commit is contained in:
@@ -241,9 +241,9 @@ public class Project implements ProjectTreeNode, Serializable, JsonSerializable
|
|||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
p = (Project) SettingsSave.loadInstance(f, "Project");
|
p = (Project) SettingsSave.loadInstance(f, "Project");
|
||||||
|
p.baseFolder = projRoot;
|
||||||
}
|
}
|
||||||
p.save();
|
p.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
p.refreshTransients(w);
|
p.refreshTransients(w);
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class Workspace implements ProjectTreeNode, Serializable, JsonSerializabl
|
|||||||
w = loadWorkspaceFromJson(workspaceRoot, f2);
|
w = loadWorkspaceFromJson(workspaceRoot, f2);
|
||||||
w.refreshTransients();
|
w.refreshTransients();
|
||||||
} else {
|
} 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);
|
File f = new File(workspaceRoot, WS_SETTINGS_FILE);
|
||||||
if (!workspaceRoot.exists() || !f.exists()) {
|
if (!workspaceRoot.exists() || !f.exists()) {
|
||||||
w = new Workspace(workspaceRoot);
|
w = new Workspace(workspaceRoot);
|
||||||
@@ -123,10 +123,13 @@ public class Workspace implements ProjectTreeNode, Serializable, JsonSerializabl
|
|||||||
w = (Workspace) SettingsSave.loadInstance(f, "Workspace");
|
w = (Workspace) SettingsSave.loadInstance(f, "Workspace");
|
||||||
if (w == null) {
|
if (w == null) {
|
||||||
w = new Workspace(workspaceRoot);
|
w = new Workspace(workspaceRoot);
|
||||||
w.save();
|
|
||||||
} else {
|
} else {
|
||||||
|
w.settingsFile = f2;
|
||||||
|
w.baseFolder = workspaceRoot;
|
||||||
|
Notification.addInfo("Switched workspace to json format.");
|
||||||
w.refreshTransients();
|
w.refreshTransients();
|
||||||
}
|
}
|
||||||
|
w.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activeWorkspace = w;
|
activeWorkspace = w;
|
||||||
|
|||||||
Reference in New Issue
Block a user