about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-01-10 19:23:59 +0000
committerJames Booth <boothj5@gmail.com>2015-01-10 19:23:59 +0000
commit7256e49396c4d5f06de591a03c9e455ffa243b2f (patch)
treefef4b68704569611ba609f1949bebdb100e3ab1f /src
parent31c0f2ba788b19d776da5e7368280091c8d3bbdf (diff)
parentc77a731cf07c2061713bf25506516a3938edf3b3 (diff)
downloadprofani-tty-7256e49396c4d5f06de591a03c9e455ffa243b2f.tar.gz
Merge branch 'master' into chat-sessions
Diffstat (limited to 'src')
-rw-r--r--src/config/preferences.c10
-rw-r--r--src/config/preferences.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index aeff94f1..fe6d0626 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -52,6 +52,7 @@
 #include "preferences.h"
 #include "tools/autocomplete.h"
 
+// preference groups refer to the sections in .profrc, for example [ui]
 #define PREF_GROUP_LOGGING "logging"
 #define PREF_GROUP_CHATSTATES "chatstates"
 #define PREF_GROUP_UI "ui"
@@ -487,6 +488,9 @@ _get_preferences_file(void)
     return result;
 }
 
+// get the preference group for a specific preference
+// for example the PREF_BEEP setting ("beep" in .profrc, see _get_key) belongs
+// to the [ui] section.
 static const char *
 _get_group(preference_t pref)
 {
@@ -552,6 +556,8 @@ _get_group(preference_t pref)
     }
 }
 
+// get the key used in .profrc for the preference
+// for example the PREF_AUTOAWAY_MODE maps to "autoaway.mode" in .profrc
 static const char *
 _get_key(preference_t pref)
 {
@@ -658,6 +664,8 @@ _get_key(preference_t pref)
     }
 }
 
+// the default setting for a boolean type preference
+// if it is not specified in .profrc
 static gboolean
 _get_default_boolean(preference_t pref)
 {
@@ -681,6 +689,8 @@ _get_default_boolean(preference_t pref)
     }
 }
 
+// the default setting for a string type preference
+// if it is not specified in .profrc
 static char *
 _get_default_string(preference_t pref)
 {
diff --git a/src/config/preferences.h b/src/config/preferences.h
index 54b4cefe..0a953482 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -47,6 +47,8 @@
 #define PREFS_MIN_LOG_SIZE 64
 #define PREFS_MAX_LOG_SIZE 1048580
 
+// represents all settings in .profrc
+// each enum value is mapped to a group and key in .profrc (see preferences.c)
 typedef enum {
     PREF_SPLASH,
     PREF_BEEP,