SF.net SVN: geany:[5546] branches/sm/src

statc at users.sourceforge.net statc at xxxxx
Sun Feb 27 08:45:10 UTC 2011


Revision: 5546
          http://geany.svn.sourceforge.net/geany/?rev=5546&view=rev
Author:   statc
Date:     2011-02-27 08:45:10 +0000 (Sun, 27 Feb 2011)

Log Message:
-----------
Fix opening a project when "Use project session files" preference is disabled.  This bug was introduced in sm branch.

Modified Paths:
--------------
    branches/sm/src/main.c
    branches/sm/src/main.h
    branches/sm/src/socket.c

Modified: branches/sm/src/main.c
===================================================================
--- branches/sm/src/main.c	2011-02-27 08:44:38 UTC (rev 5545)
+++ branches/sm/src/main.c	2011-02-27 08:45:10 UTC (rev 5546)
@@ -889,7 +889,8 @@
 }
 
 
-void main_load_project_from_command_line(const gchar *locale_filename, gboolean load_files)
+void main_load_project_from_command_line(const gchar *locale_filename,
+	gboolean use_session, gboolean load_files)
 {
 	gchar *pfile = NULL;
 
@@ -900,10 +901,10 @@
 
 	if (pfile != NULL)
 	{
-		if (load_files)
+		if (use_session)
 			project_load_file_with_session(pfile);
 		else
-			project_load_file(pfile, FALSE);
+			project_load_file(pfile, load_files);
 	}
 
 	g_free(pfile);
@@ -923,7 +924,14 @@
 	{
 		/* Do not load project session files if we are being restored by session manager:
 		 * corresponding file names are passed via command-line and will be handled by open_cl_files() */
-		main_load_project_from_command_line(cl_options.project, !main_status.restoring);
+		main_load_project_from_command_line(cl_options.project, FALSE, !main_status.restoring);
+
+		/* If project sessions are enabled, this call will load filenames stored in project file.
+		 * Otherwise, it will load filenames from default session, thus we take
+		 * `load_default_session' variable into account. */
+		if (!main_status.restoring && (project_prefs.project_session || load_default_session))
+			configuration_open_files();
+
 		load_default_session = FALSE;
 	}
 

Modified: branches/sm/src/main.h
===================================================================
--- branches/sm/src/main.h	2011-02-27 08:44:38 UTC (rev 5545)
+++ branches/sm/src/main.h	2011-02-27 08:45:10 UTC (rev 5546)
@@ -85,6 +85,9 @@
 
 gboolean main_is_realized(void);
 
-void main_load_project_from_command_line(const gchar *locale_filename, gboolean load_files);
+/* Here load_files argument is valid if and only if use_session is FALSE.
+ * In other words, use_session implies load_files. */
+void main_load_project_from_command_line(const gchar *locale_filename,
+	gboolean use_session, gboolean load_files);
 
 #endif

Modified: branches/sm/src/socket.c
===================================================================
--- branches/sm/src/socket.c	2011-02-27 08:44:38 UTC (rev 5545)
+++ branches/sm/src/socket.c	2011-02-27 08:45:10 UTC (rev 5546)
@@ -573,7 +573,7 @@
 		if (project)
 		{
 			if (project_ask_close())
-				main_load_project_from_command_line(locale_filename, TRUE);
+				main_load_project_from_command_line(locale_filename, TRUE, TRUE);
 		}
 		else
 			main_handle_filename(locale_filename);


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