+static GnomePrintConfig *
+load_print_config_from_file (void)
+{
+ GnomePrintConfig *print_config = NULL;
+ char *file_name, *contents = NULL;
+
+ file_name = g_build_filename (ev_dot_dir (), PRINT_CONFIG_FILENAME,
+ NULL);
+
+ if (g_file_get_contents (file_name, &contents, NULL, NULL)) {
+ print_config = gnome_print_config_from_string (contents, 0);
+ g_free (contents);
+ }
+
+ if (print_config == NULL) {
+ print_config = gnome_print_config_default ();
+ }
+
+ g_free (file_name);
+
+ return print_config;
+}
+
+static void
+save_print_config_to_file (GnomePrintConfig *config)
+{
+ char *file_name, *str;
+
+ g_return_if_fail (config != NULL);
+
+ str = gnome_print_config_to_string (config, 0);
+ if (str == NULL) return;
+
+ file_name = g_build_filename (ev_dot_dir (),
+ PRINT_CONFIG_FILENAME,
+ NULL);
+
+#ifdef HAVE_G_FILE_SET_CONTENTS
+ g_file_set_contents (file_name, str, -1, NULL);
+#else
+ ev_file_set_contents (file_name, str, -1, NULL);
+#endif
+
+ g_free (file_name);
+ g_free (str);
+}
+