Skip to content

Commit

Permalink
tools: avoid using state dir for now
Browse files Browse the repository at this point in the history
  • Loading branch information
dbartolini committed Oct 26, 2024
1 parent 2368556 commit 4061783
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tools/level_editor/level_editor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -3931,7 +3931,6 @@ public static GLib.File _toolchain_dir;
public static GLib.File _templates_dir;
public static GLib.File _data_dir;
public static GLib.File _config_dir;
public static GLib.File _state_dir;
public static GLib.File _cache_dir;
public static GLib.File _logs_dir;
public static GLib.File _thumbnails_dir;
Expand Down Expand Up @@ -4113,19 +4112,13 @@ public static int main(string[] args)
} catch (Error e) {
/* Nobody cares */
}
_state_dir = GLib.File.new_for_path(GLib.Path.build_filename(GLib.Environment.get_user_state_dir(), "crown"));
try {
_state_dir.make_directory();
} catch (Error e) {
/* Nobody cares */
}
_cache_dir = GLib.File.new_for_path(GLib.Path.build_filename(GLib.Environment.get_user_cache_dir(), "crown"));
try {
_cache_dir.make_directory();
} catch (Error e) {
/* Nobody cares */
}
_logs_dir = GLib.File.new_for_path(GLib.Path.build_filename(_state_dir.get_path(), "logs"));
_logs_dir = GLib.File.new_for_path(GLib.Path.build_filename(_data_dir.get_path(), "logs"));
try {
_logs_dir.make_directory();
} catch (Error e) {
Expand Down Expand Up @@ -4154,9 +4147,9 @@ public static int main(string[] args)
return launcher_main(args);

_settings_file = GLib.File.new_for_path(GLib.Path.build_filename(_config_dir.get_path(), "settings.sjson"));
_window_state_file = GLib.File.new_for_path(GLib.Path.build_filename(_state_dir.get_path(), "window.sjson"));
_window_state_file = GLib.File.new_for_path(GLib.Path.build_filename(_data_dir.get_path(), "window.sjson"));
_user_file = GLib.File.new_for_path(GLib.Path.build_filename(_data_dir.get_path(), "user.sjson"));
_console_history_file = GLib.File.new_for_path(GLib.Path.build_filename(_state_dir.get_path(), "console_history.txt"));
_console_history_file = GLib.File.new_for_path(GLib.Path.build_filename(_data_dir.get_path(), "console_history.txt"));

// Connect to SubprocessLauncher service.
SubprocessLauncher subprocess_launcher;
Expand Down

0 comments on commit 4061783

Please sign in to comment.