SF.net SVN: geany:[4971] branches/sm

statc at users.sourceforge.net statc at xxxxx
Mon May 31 09:24:21 UTC 2010


Revision: 4971
          http://geany.svn.sourceforge.net/geany/?rev=4971&view=rev
Author:   statc
Date:     2010-05-31 09:24:21 +0000 (Mon, 31 May 2010)

Log Message:
-----------
Apply patches by Dimitar Zhekov to not save settings edited in the Preferences Dialog to geany.conf on exit.

Modified Paths:
--------------
    branches/sm/ChangeLog.sm
    branches/sm/src/keyfile.c
    branches/sm/src/keyfile.h
    branches/sm/src/main.c
    branches/sm/src/prefs.c
    branches/sm/src/project.c

Modified: branches/sm/ChangeLog.sm
===================================================================
--- branches/sm/ChangeLog.sm	2010-05-31 09:23:56 UTC (rev 4970)
+++ branches/sm/ChangeLog.sm	2010-05-31 09:24:21 UTC (rev 4971)
@@ -3,6 +3,9 @@
  * src/main.c:
    Fix a bug: files specified in command line did not open together
    with default session if the session "referenced" a project.
+ * src/keyfile.c, src/keyfile.h, src/main.c, src/prefs.c, src/project.c:
+   Apply patches by Dimitar Zhekov to not save settings edited in the
+   Preferences Dialog to geany.conf on exit.
 
 
 2010-02-23  Eugene Arshinov  <earshinov(at)gmail(dot)com>

Modified: branches/sm/src/keyfile.c
===================================================================
--- branches/sm/src/keyfile.c	2010-05-31 09:23:56 UTC (rev 4970)
+++ branches/sm/src/keyfile.c	2010-05-31 09:24:21 UTC (rev 4971)
@@ -332,8 +332,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);
 
@@ -481,6 +487,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);
 }
 
 
@@ -546,7 +560,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");

Modified: branches/sm/src/keyfile.h
===================================================================
--- branches/sm/src/keyfile.h	2010-05-31 09:23:56 UTC (rev 4970)
+++ branches/sm/src/keyfile.h	2010-05-31 09:24:21 UTC (rev 4971)
@@ -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);

Modified: branches/sm/src/main.c
===================================================================
--- branches/sm/src/main.c	2010-05-31 09:23:56 UTC (rev 4970)
+++ branches/sm/src/main.c	2010-05-31 09:24:21 UTC (rev 4971)
@@ -1196,7 +1196,8 @@
 	if (interactive && !document_account_for_unsaved())
 		return FALSE;
 
-	configuration_save();
+	if (!cl_options.new_instance)
+		configuration_save();
 
 	if (app->project)
 		project_save(FALSE);

Modified: branches/sm/src/prefs.c
===================================================================
--- branches/sm/src/prefs.c	2010-05-31 09:23:56 UTC (rev 4970)
+++ branches/sm/src/prefs.c	2010-05-31 09:24:21 UTC (rev 4971)
@@ -1182,7 +1182,7 @@
 		ui_update_view_editor_menu_items();
 
 		/* store all settings */
-		configuration_save();
+		configuration_save_dialog_prefs();
 	}
 
 	if (response != GTK_RESPONSE_APPLY)

Modified: branches/sm/src/project.c
===================================================================
--- branches/sm/src/project.c	2010-05-31 09:23:56 UTC (rev 4970)
+++ branches/sm/src/project.c	2010-05-31 09:24:21 UTC (rev 4971)
@@ -1006,7 +1006,8 @@
 	if (project_prefs.project_session)
 	{
 		/* save current (non-project) session (it could has been changed since program startup) */
-		configuration_save_default_session();
+		if (!cl_options.new_instance)
+			configuration_save_default_session();
 		/* now close all open files */
 		document_close_all(FALSE);
 		/* read session files so they can be opened with configuration_open_files() */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list