Allow opening Geany projects remotely.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4455 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
4f32cbbc0e
commit
d9e7c95531
@ -5,6 +5,8 @@
|
|||||||
Add main_is_realized() to the plugin API.
|
Add main_is_realized() to the plugin API.
|
||||||
* tagmanager/include/tm_tagmanager.h:
|
* tagmanager/include/tm_tagmanager.h:
|
||||||
Update partly outdated and wrong doc comment.
|
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>
|
2009-11-26 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
|
||||||
|
30
src/main.c
30
src/main.c
@ -830,6 +830,26 @@ static void load_settings(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
static void load_startup_files(gint argc, gchar **argv)
|
||||||
{
|
{
|
||||||
gboolean load_project_from_cl = FALSE;
|
gboolean load_project_from_cl = FALSE;
|
||||||
@ -845,15 +865,7 @@ static void load_startup_files(gint argc, gchar **argv)
|
|||||||
{
|
{
|
||||||
if (load_project_from_cl)
|
if (load_project_from_cl)
|
||||||
{
|
{
|
||||||
gchar *pfile = argv[1];
|
main_load_project_from_command_line(argv[1], FALSE);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (cl_options.load_session && !cl_options.new_instance)
|
else if (cl_options.load_session && !cl_options.new_instance)
|
||||||
load_session_project_file();
|
load_session_project_file();
|
||||||
|
@ -66,4 +66,6 @@ void main_locale_init(const gchar *locale_dir, const gchar *gettext_package);
|
|||||||
|
|
||||||
gboolean main_is_realized(void);
|
gboolean main_is_realized(void);
|
||||||
|
|
||||||
|
void main_load_project_from_command_line(const gchar *locale_filename, gboolean use_session);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -504,7 +504,12 @@ static void handle_input_filename(const gchar *buf)
|
|||||||
|
|
||||||
locale_filename = utils_get_locale_from_utf8(utf8_filename);
|
locale_filename = utils_get_locale_from_utf8(utf8_filename);
|
||||||
if (locale_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(utf8_filename);
|
||||||
g_free(locale_filename);
|
g_free(locale_filename);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user