Merge commit 'upstream/0.2.4'
[debian/pino.git] / src / prefs.vala
index ab47d78..ec90651 100644 (file)
@@ -44,6 +44,16 @@ public class Prefs : Object {
                set{ _urlShorten = value; }
        }
        
+       public signal void enableSpellChanged();
+       private bool _enableSpell = true;
+       public bool enableSpell {
+               get{ return _enableSpell; }
+               set{
+                       _enableSpell = value;
+                       enableSpellChanged();
+               }
+       }
+       
        private bool _showTimelineNotify = true;
        public bool showTimelineNotify {
                get{ return _showTimelineNotify; }
@@ -258,15 +268,18 @@ public class Prefs : Object {
        }
        
        public LoadStatus load() {
-               string conf_dir = Environment.get_home_dir() + "/.config/";
+               //string conf_dir = Environment.get_home_dir() + "/.config/";
+               string pino_dir = Environment.get_user_config_dir() + "/%s".printf(Config.APPNAME);
                
+               /*
                var dir = File.new_for_path(conf_dir);
                if(!dir.query_exists(null))
                        dir.make_directory(null);
                
                string pino_dir = conf_dir + "/pino";
                
-               dir = File.new_for_path(pino_dir);
+               dir = File.new_for_path(pino_dir);*/
+               var dir = File.new_for_path(pino_dir);
                if(!dir.query_exists(null))
                        dir.make_directory(null);
                
@@ -314,6 +327,10 @@ public class Prefs : Object {
                                        _urlShorten = iter->get_content();
                                        break;
                                
+                               case "enableSpell":
+                                       _enableSpell = iter->get_content().to_bool();
+                                       break;
+                               
                                case "showTimelineNotify":
                                        _showTimelineNotify = iter->get_content().to_bool();
                                        break;
@@ -415,6 +432,8 @@ public class Prefs : Object {
         root->add_content("\n");
         root->new_text_child(ns, "urlShorten", _urlShorten);
         root->add_content("\n");
+        root->new_text_child(ns, "enableSpell", _enableSpell.to_string());
+        root->add_content("\n");
         root->new_text_child(ns, "showTimelineNotify", _showTimelineNotify.to_string());
         root->add_content("\n");
         root->new_text_child(ns, "showMentionsNotify", _showMentionsNotify.to_string());