prefs.c: consistent indentation
This commit is contained in:
parent
08f868a3e0
commit
88feee2703
15
src/prefs.c
15
src/prefs.c
@ -142,7 +142,8 @@ gchar *pref_bool_to_str(gboolean val) {
|
|||||||
|
|
||||||
/* we use very lame preferences file format: ``property=value\n''.
|
/* we use very lame preferences file format: ``property=value\n''.
|
||||||
so - there must be no whitespaces on begin/end of line =) */
|
so - there must be no whitespaces on begin/end of line =) */
|
||||||
void load_preferences(void) {
|
void load_preferences(void)
|
||||||
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
gchar *rc_file;
|
gchar *rc_file;
|
||||||
gchar buffer[BUFFER_SIZE];
|
gchar buffer[BUFFER_SIZE];
|
||||||
@ -152,11 +153,14 @@ void load_preferences(void) {
|
|||||||
_theme_name = g_strdup(_default_theme_name);
|
_theme_name = g_strdup(_default_theme_name);
|
||||||
}
|
}
|
||||||
rc_file = find_rc_file();
|
rc_file = find_rc_file();
|
||||||
if((fp = fopen(rc_file, "r"))) {
|
if ((fp = fopen(rc_file, "r")))
|
||||||
while(fgets(buffer, BUFFER_SIZE, fp)) {
|
{
|
||||||
|
while(fgets(buffer, BUFFER_SIZE, fp))
|
||||||
|
{
|
||||||
g_strchomp(buffer);
|
g_strchomp(buffer);
|
||||||
prop_val = g_strsplit(buffer, "=", 2);
|
prop_val = g_strsplit(buffer, "=", 2);
|
||||||
if(prop_val[0] && prop_val[0][0] && prop_val[1] && prop_val[1][0]) {
|
if (prop_val[0] && prop_val[0][0] && prop_val[1] && prop_val[1][0])
|
||||||
|
{
|
||||||
if (!g_ascii_strcasecmp(prop_val[0], "show_hints")) {
|
if (!g_ascii_strcasecmp(prop_val[0], "show_hints")) {
|
||||||
_show_next_colors = pref_str_to_bool(prop_val[1]);
|
_show_next_colors = pref_str_to_bool(prop_val[1]);
|
||||||
} else if (!g_ascii_strcasecmp(prop_val[0], "show_path")) {
|
} else if (!g_ascii_strcasecmp(prop_val[0], "show_path")) {
|
||||||
@ -209,7 +213,8 @@ void write_pref_int(FILE *fp, gchar *property, gint value) {
|
|||||||
fprintf (fp, "%s=%d\n", property, value);
|
fprintf (fp, "%s=%d\n", property, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *save_preferences(void) {
|
gchar *save_preferences (void)
|
||||||
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
gchar *rc_file/*, *err*/;
|
gchar *rc_file/*, *err*/;
|
||||||
gchar *ret = NULL;
|
gchar *ret = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user