Revision: 3707 http://geany.svn.sourceforge.net/geany/?rev=3707&view=rev Author: eht16 Date: 2009-04-15 22:46:13 +0000 (Wed, 15 Apr 2009)
Log Message: ----------- Fix duplicating the recent files and projects lists when closing a project.
Modified Paths: -------------- trunk/ChangeLog trunk/src/keyfile.c trunk/src/keyfile.h trunk/src/project.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-04-09 12:41:29 UTC (rev 3706) +++ trunk/ChangeLog 2009-04-15 22:46:13 UTC (rev 3707) @@ -1,3 +1,10 @@ +2009-04-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/keyfile.c, src/keyfile.h, src/project.c: + Fix duplicating the recent files and projects lists when closing + a project. + + 2009-04-09 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/symbols.c:
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2009-04-09 12:41:29 UTC (rev 3706) +++ trunk/src/keyfile.c 2009-04-15 22:46:13 UTC (rev 3707) @@ -507,6 +507,7 @@ project_save_prefs(config); /* save project filename, etc. */ save_recent_files(config, ui_prefs.recent_queue, "recent_files"); save_recent_files(config, ui_prefs.recent_projects_queue, "recent_projects"); + if (cl_options.load_session) configuration_save_session_files(config);
@@ -533,8 +534,8 @@ gchar *filename = g_strdup(recent_files[i]); g_queue_push_tail(queue, filename); } + g_strfreev(recent_files); } - g_strfreev(recent_files); }
@@ -542,7 +543,7 @@ * Load session list from the given keyfile, and store it in the global * session_files variable for later file loading * */ -void configuration_load_session_files(GKeyFile *config) +void configuration_load_session_files(GKeyFile *config, gboolean read_recent_files) { guint i; gboolean have_session_files; @@ -552,8 +553,11 @@
session_notebook_page = utils_get_setting_integer(config, "files", "current_page", -1);
- load_recent_files(config, ui_prefs.recent_queue, "recent_files"); - load_recent_files(config, ui_prefs.recent_projects_queue, "recent_projects"); + if (read_recent_files) + { + load_recent_files(config, ui_prefs.recent_queue, "recent_files"); + load_recent_files(config, ui_prefs.recent_projects_queue, "recent_projects"); + }
/* the project may load another list than the main setting */ if (session_files != NULL) @@ -865,7 +869,7 @@
g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
- configuration_load_session_files(config); + configuration_load_session_files(config, FALSE);
g_key_file_free(config); g_free(configfile); @@ -889,7 +893,7 @@ load_dialog_prefs(config); load_ui_prefs(config); project_load_prefs(config); - configuration_load_session_files(config); + configuration_load_session_files(config, TRUE);
g_key_file_free(config); g_free(configfile);
Modified: trunk/src/keyfile.h =================================================================== --- trunk/src/keyfile.h 2009-04-09 12:41:29 UTC (rev 3706) +++ trunk/src/keyfile.h 2009-04-15 22:46:13 UTC (rev 3707) @@ -47,7 +47,7 @@
void configuration_save_default_session(void);
-void configuration_load_session_files(GKeyFile *config); +void configuration_load_session_files(GKeyFile *config, gboolean read_recent_files);
void configuration_save_session_files(GKeyFile *config);
Modified: trunk/src/project.c =================================================================== --- trunk/src/project.c 2009-04-09 12:41:29 UTC (rev 3706) +++ trunk/src/project.c 2009-04-15 22:46:13 UTC (rev 3707) @@ -341,7 +341,7 @@ document_close_all();
/* after closing all tabs let's open the tabs found in the default config */ - if (open_default == TRUE && cl_options.load_session) + if (open_default && cl_options.load_session) { configuration_reload_default_session(); configuration_open_files(); @@ -953,7 +953,7 @@ /* now close all open files */ document_close_all(); /* read session files so they can be opened with configuration_open_files() */ - configuration_load_session_files(config); + configuration_load_session_files(config, FALSE); } g_signal_emit_by_name(geany_object, "project-open", config); g_key_file_free(config);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.