Allow and use arguments to the browser command (closes #1989575).
Add 'xdg-open' as first browser fallback. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2675 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
9ab442e146
commit
0d4cbd60a1
@ -1,3 +1,10 @@
|
||||
2008-06-10 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
|
||||
* src/utils.c:
|
||||
Allow and use arguments to the browser command (closes #1989575).
|
||||
Add 'xdg-open' as first browser fallback.
|
||||
|
||||
|
||||
2008-06-10 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* tagmanager/python.c:
|
||||
|
43
src/utils.c
43
src/utils.c
@ -62,33 +62,44 @@ void utils_start_browser(const gchar *uri)
|
||||
#ifdef G_OS_WIN32
|
||||
win32_open_browser(uri);
|
||||
#else
|
||||
const gchar *argv[3];
|
||||
gchar *cmdline = g_strconcat(tool_prefs.browser_cmd, " ", uri, NULL);
|
||||
|
||||
argv[0] = tool_prefs.browser_cmd;
|
||||
argv[1] = uri;
|
||||
argv[2] = NULL;
|
||||
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL))
|
||||
if (! g_spawn_command_line_async(cmdline, NULL))
|
||||
{
|
||||
argv[0] = "firefox";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL))
|
||||
const gchar *argv[3];
|
||||
|
||||
argv[0] = "xdg-open";
|
||||
argv[1] = uri;
|
||||
argv[2] = NULL;
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL))
|
||||
{
|
||||
argv[0] = "mozilla";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL))
|
||||
argv[0] = "firefox";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL))
|
||||
{
|
||||
argv[0] = "opera";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL))
|
||||
argv[0] = "mozilla";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL,
|
||||
NULL, NULL, NULL))
|
||||
{
|
||||
argv[0] = "konqueror";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL))
|
||||
argv[0] = "opera";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL))
|
||||
{
|
||||
argv[0] = "netscape";
|
||||
g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
|
||||
argv[0] = "konqueror";
|
||||
if (! g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL))
|
||||
{
|
||||
argv[0] = "netscape";
|
||||
g_spawn_async(NULL, (gchar**)argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
g_free(cmdline);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user