recent version of libjson has remove is_error which was checking
[ptask.git] / src / settings.c
index 2f617c6..bfe8d5b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2013 jeanfi@gmail.com
+ * Copyright (C) 2012-2016 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -27,6 +27,7 @@ const char *SETTINGS_KEY_SPLITER_VERTICAL_POS = "spliter-vertical-pos";
 const char *SETTINGS_KEY_SPLITER_HORIZONTAL_POS = "spliter-horizontal-pos";
 const char *SETTINGS_KEY_TASKS_SORT_COL = "tasks-sort-col";
 const char *SETTINGS_KEY_TASKS_SORT_ORDER = "tasks-sort-order";
+const char *SETTINGS_KEY_NOTES_DIR = "notes-dir";
 
 const char * const SETTINGS_VISIBLE_COL_KEYS[] = {
        "tasktree-id-visible",
@@ -66,3 +67,23 @@ void settings_set_boolean(const gchar *key, gboolean value)
 {
        g_settings_set_boolean(settings, key, value);
 }
+
+gchar *settings_get_str(const gchar *key)
+{
+       return g_settings_get_string(settings, key);
+}
+
+void settings_set_str(const gchar *key, const gchar *value)
+{
+       g_settings_set_string(settings, key, value);
+}
+
+const char *settings_get_notes_dir()
+{
+       return settings_get_str(SETTINGS_KEY_NOTES_DIR);
+}
+
+void settings_set_notes_dir(const char *dir)
+{
+       settings_set_str(SETTINGS_KEY_NOTES_DIR, dir);
+}