Hopefully a fix for the save settings into geany.conf issue.

-- 
E-gards: Jimmy
--- ./src/callbacks.c.orig	2010-05-14 14:24:09.000000000 +0300
+++ ./src/callbacks.c	2010-05-21 16:16:54.000000000 +0300
@@ -117,7 +117,8 @@
 /* should only be called from on_exit_clicked */
 static void quit_app(void)
 {
-	configuration_save();
+	if (!cl_options.new_instance)
+		configuration_save();
 
 	if (app->project != NULL)
 		project_close(FALSE);	/* save project session files */
--- ./src/keyfile.c.orig	2010-05-19 11:52:31.000000000 +0300
+++ ./src/keyfile.c	2010-05-21 16:15:01.000000000 +0300
@@ -330,8 +330,14 @@
 }
 
 
-static void save_dialog_prefs(GKeyFile *config)
+void configuration_save_dialog_prefs(void)
 {
+	GKeyFile *config = g_key_file_new();
+	gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
+	gchar *data;
+
+	g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
+
 	/* new settings should be added in init_pref_groups() */
 	settings_action(config, SETTING_WRITE);
 
@@ -477,6 +483,14 @@
 		g_key_file_set_string(config, "VTE", "last_dir", vte_info.dir);
 	}
 #endif
+
+	/* write the file */
+	data = g_key_file_to_data(config, NULL, NULL);
+	utils_write_file(configfile, data);
+	g_free(data);
+
+	g_key_file_free(config);
+	g_free(configfile);
 }
 
 
@@ -542,7 +556,6 @@
 	/* this signal can be used e.g. to prepare any settings before Stash code reads them below */
 	g_signal_emit_by_name(geany_object, "save-settings", config);
 
-	save_dialog_prefs(config);
 	save_ui_prefs(config);
 	project_save_prefs(config);	/* save project filename, etc. */
 	save_recent_files(config, ui_prefs.recent_queue, "recent_files");
--- ./src/keyfile.h.orig	2010-05-14 14:24:09.000000000 +0300
+++ ./src/keyfile.h	2010-05-21 16:15:45.000000000 +0300
@@ -37,6 +37,8 @@
 
 void configuration_add_pref_group(struct StashGroup *group, gboolean for_prefs_dialog);
 
+void configuration_save_dialog_prefs(void);
+
 void configuration_save(void);
 
 gboolean configuration_load(void);
--- ./src/prefs.c.orig	2010-05-19 11:52:31.000000000 +0300
+++ ./src/prefs.c	2010-05-21 16:16:07.000000000 +0300
@@ -1175,7 +1175,7 @@
 		ui_update_view_editor_menu_items();
 
 		/* store all settings */
-		configuration_save();
+		configuration_save_dialog_prefs();
 	}
 
 	if (response != GTK_RESPONSE_APPLY)
_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to