about summary refs log tree commit diff stats
path: root/src/config/theme.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-09-25 21:47:00 +0100
committerJames Booth <boothj5@gmail.com>2016-09-25 21:47:00 +0100
commit83974728af4030d829295b8a03def367f9fe14e8 (patch)
treea69e6caf0d0003632ec0a6c0d75392b1c0a17f60 /src/config/theme.c
parent72f6b2db71bffd47c856689f70aad4cccfe8ad97 (diff)
downloadprofani-tty-83974728af4030d829295b8a03def367f9fe14e8.tar.gz
Remove verbose output on window move
Diffstat (limited to 'src/config/theme.c')
-rw-r--r--src/config/theme.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/config/theme.c b/src/config/theme.c
index cee95883..44c9c3ff 100644
--- a/src/config/theme.c
+++ b/src/config/theme.c
@@ -531,13 +531,18 @@ _load_preferences(void)
         }
     }
 
-    int titlebar_pos = g_key_file_get_integer(theme, "ui", "titlebar.position", NULL);
-    int mainwin_pos = g_key_file_get_integer(theme, "ui", "mainwin.position", NULL);
-    int statusbar_pos = g_key_file_get_integer(theme, "ui", "statusbar.position", NULL);
-    int inputwin_pos = g_key_file_get_integer(theme, "ui", "inputwin.position", NULL);
-    ProfWinPlacement *placement = prefs_create_profwin_placement(titlebar_pos, mainwin_pos, statusbar_pos, inputwin_pos);
-    prefs_save_win_placement(placement);
-    prefs_free_win_placement(placement);
+    if (g_key_file_has_key(theme, "ui", "titlebar.position", NULL) &&
+            g_key_file_has_key(theme, "ui", "mainwin.position", NULL) &&
+            g_key_file_has_key(theme, "ui", "statusbar.position", NULL) &&
+            g_key_file_has_key(theme, "ui", "inputwin.position", NULL)) {
+        int titlebar_pos = g_key_file_get_integer(theme, "ui", "titlebar.position", NULL);
+        int mainwin_pos = g_key_file_get_integer(theme, "ui", "mainwin.position", NULL);
+        int statusbar_pos = g_key_file_get_integer(theme, "ui", "statusbar.position", NULL);
+        int inputwin_pos = g_key_file_get_integer(theme, "ui", "inputwin.position", NULL);
+        ProfWinPlacement *placement = prefs_create_profwin_placement(titlebar_pos, mainwin_pos, statusbar_pos, inputwin_pos);
+        prefs_save_win_placement(placement);
+        prefs_free_win_placement(placement);
+    }
 }
 
 void