/loggerouter/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerouter/trunk

« back to all changes in this revision

Viewing changes to src/settings.vala

  • Committer: Gustav Hartvigsson
  • Date: 2025-06-04 14:25:01 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20250604142501-uhe0ukoxuwcku2bt
Fixed crash caused from missing config file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  
29
29
  //TODO: Timer countdown setting.
30
30
 
31
 
  public string to_string () {
 
31
  string to_string () {
32
32
    var builder = new StringBuilder ();
33
33
    builder.append_printf ("key_file: %px\n", key_file);
34
34
    builder.append_printf ("config_path: %s", config_path);
45
45
  private Settings () {}
46
46
 
47
47
  public void load_settings (string config_path) {
 
48
    print ("path\n");
48
49
    key_file = new GLib.KeyFile ();
49
50
    this.config_path = config_path;
50
51
    parse_key_file ();
51
52
  }
52
53
 
53
54
  public void load_setting_from_xdg () {
 
55
    print ("xdg\n");
54
56
    key_file = new GLib.KeyFile ();
55
57
    this.config_path = LO_XDG_CONFIG_PATH;
56
58
    if (GLib.File.new_for_path (this.config_path).query_exists ()) {
63
65
 
64
66
  private void parse_key_file ()
65
67
  requires (key_file != null) {
 
68
    print ("Hello!\n");
66
69
    try {
67
70
      key_file.load_from_file (this.config_path, GLib.KeyFileFlags.NONE);
68
71
    } catch (GLib.FileError e) {