diff options
author | Burt P <pburt0@gmail.com> | 2019-07-30 16:49:16 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-07-31 17:13:07 -0700 |
commit | ff8078c66110e8ea36240c47bc1f069b44d3ab99 (patch) | |
tree | a0857b9f6b253dae1e6c8bc3f5cde386e6bc7da3 | |
parent | b4337288f40bcc8fdadb8807647f0e0409ebf5af (diff) |
Remove old open_url() in favor or uri_open()
See:
https://github.com/lpereira/hardinfo/pull/417#discussion_r308512774
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r-- | hardinfo/util.c | 32 | ||||
-rw-r--r-- | includes/hardinfo.h | 1 | ||||
-rw-r--r-- | shell/callbacks.c | 4 | ||||
-rw-r--r-- | shell/report.c | 2 |
4 files changed, 3 insertions, 36 deletions
diff --git a/hardinfo/util.c b/hardinfo/util.c index b35b2461..1b92457c 100644 --- a/hardinfo/util.c +++ b/hardinfo/util.c @@ -539,38 +539,6 @@ gboolean ui_init(int *argc, char ***argv) return gtk_init_check(argc, argv); } -void open_url(gchar * url) -{ - const gchar *browsers[] = { - "xdg-open", "gnome-open", "kfmclient openURL", - "sensible-browser", "firefox", "epiphany", - "iceweasel", "seamonkey", "galeon", "mozilla", - "opera", "konqueror", "netscape", "links -g", - NULL - }; - gint i = 0; - gchar *browser = (gchar *)g_getenv("BROWSER"); - - if (!browser || *browser == '\0') { - browser = (gchar *)browsers[i++]; - } - - do { - gchar *cmdline = g_strdup_printf("%s '%s'", browser, url); - - if (g_spawn_command_line_async(cmdline, NULL)) { - g_free(cmdline); - return; - } - - g_free(cmdline); - - browser = (gchar *)browsers[i++]; - } while (browser); - - g_warning(_("Couldn't find a Web browser to open URL %s."), url); -} - /* Copyright: Jens Låås, SLU 2002 */ gchar *strreplacechr(gchar * string, gchar * replace, gchar new_char) { diff --git a/includes/hardinfo.h b/includes/hardinfo.h index 5c9863cc..c8ee1ca0 100644 --- a/includes/hardinfo.h +++ b/includes/hardinfo.h @@ -126,7 +126,6 @@ gpointer file_types_get_data_by_name(FileTypes *file_types, gchar *name); gchar *find_program(gchar *program_name); gchar *size_human_readable(gfloat size); void nonblock_sleep(guint msec); -void open_url(gchar *url); GSList *modules_get_list(void); GSList *modules_load_selected(void); GSList *modules_load_all(void); diff --git a/shell/callbacks.c b/shell/callbacks.c index c6cc743f..c116c023 100644 --- a/shell/callbacks.c +++ b/shell/callbacks.c @@ -39,12 +39,12 @@ void cb_sync_manager() void cb_open_web_page() { - open_url("http://www.hardinfo.org"); + uri_open("http://www.hardinfo.org"); } void cb_report_bug() { - open_url("https://github.com/lpereira/hardinfo"); + uri_open("https://github.com/lpereira/hardinfo"); } void cb_refresh() diff --git a/shell/report.c b/shell/report.c index 4949c557..8649d2a9 100644 --- a/shell/report.c +++ b/shell/report.c @@ -910,7 +910,7 @@ static gboolean report_generate(ReportDialog * rd) gchar *temp; temp = g_strdup_printf("file://%s", file); - open_url(temp); + uri_open(temp); g_free(temp); } |