Revision: 4455 http://geany.svn.sourceforge.net/geany/?rev=4455&view=rev Author: eht16 Date: 2009-11-29 19:59:13 +0000 (Sun, 29 Nov 2009)
Log Message: ----------- Allow opening Geany projects remotely.
Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c trunk/src/main.h trunk/src/socket.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-11-29 13:38:45 UTC (rev 4454) +++ trunk/ChangeLog 2009-11-29 19:59:13 UTC (rev 4455) @@ -5,6 +5,8 @@ Add main_is_realized() to the plugin API. * tagmanager/include/tm_tagmanager.h: Update partly outdated and wrong doc comment. + * src/main.c, src/main.h, src/socket.c: + Allow opening Geany projects remotely.
2009-11-26 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2009-11-29 13:38:45 UTC (rev 4454) +++ trunk/src/main.c 2009-11-29 19:59:13 UTC (rev 4455) @@ -830,6 +830,26 @@ }
+void main_load_project_from_command_line(const gchar *locale_filename, gboolean use_session) +{ + gchar *pfile = NULL; + + if (utils_is_uri(locale_filename)) + pfile = utils_get_path_from_uri(locale_filename); + else + pfile = g_strdup(locale_filename); + + if (pfile != NULL) + { + if (use_session) + project_load_file_with_session(pfile); + else + project_load_file(pfile); + } + g_free(pfile); +} + + static void load_startup_files(gint argc, gchar **argv) { gboolean load_project_from_cl = FALSE; @@ -845,15 +865,7 @@ { if (load_project_from_cl) { - gchar *pfile = argv[1]; - if (utils_is_uri(argv[1])) - pfile = utils_get_path_from_uri(argv[1]); - if (pfile != NULL) - { - project_load_file(pfile); - if (pfile != argv[1]) - g_free(pfile); - } + main_load_project_from_command_line(argv[1], FALSE); } else if (cl_options.load_session && !cl_options.new_instance) load_session_project_file();
Modified: trunk/src/main.h =================================================================== --- trunk/src/main.h 2009-11-29 13:38:45 UTC (rev 4454) +++ trunk/src/main.h 2009-11-29 19:59:13 UTC (rev 4455) @@ -66,4 +66,6 @@
gboolean main_is_realized(void);
+void main_load_project_from_command_line(const gchar *locale_filename, gboolean use_session); + #endif
Modified: trunk/src/socket.c =================================================================== --- trunk/src/socket.c 2009-11-29 13:38:45 UTC (rev 4454) +++ trunk/src/socket.c 2009-11-29 19:59:13 UTC (rev 4455) @@ -504,7 +504,12 @@
locale_filename = utils_get_locale_from_utf8(utf8_filename); if (locale_filename) - main_handle_filename(locale_filename); + { + if (g_str_has_suffix(locale_filename, ".geany")) + main_load_project_from_command_line(locale_filename, TRUE); + else + main_handle_filename(locale_filename); + } g_free(utf8_filename); g_free(locale_filename); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.