[frogr] Simplify code in frogr-util
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Simplify code in frogr-util
- Date: Sat, 14 Apr 2012 21:07:21 +0000 (UTC)
commit 6588b0e4e7746b70aaf2669c511304e25bbb8fa5
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Sat Apr 14 23:07:11 2012 +0200
Simplify code in frogr-util
src/frogr-util.c | 34 +++++-----------------------------
1 files changed, 5 insertions(+), 29 deletions(-)
---
diff --git a/src/frogr-util.c b/src/frogr-util.c
index 98e81e5..9c392d4 100644
--- a/src/frogr-util.c
+++ b/src/frogr-util.c
@@ -164,28 +164,13 @@ _open_uris_with_app_info (GList *uris_list, GAppInfo *app_info)
}
}
-#ifdef MAC_INTEGRATION
-static void
-_open_uri_for_mac (const gchar *uri)
+void
+frogr_util_open_uri (const gchar *uri)
{
- GList *uris_list = NULL;
-
- /* Early return */
- if (!uri)
- return;
-
- uris_list = g_list_append (uris_list, (gchar*) uri);
- _open_uris_with_app_info (uris_list, NULL);
- g_list_free (uris_list);
-}
-#endif
-
#ifndef MAC_INTEGRATION
-static void
-_open_uri_for_gnome (const gchar *uri)
-{
static GAppInfo *http_app_info = NULL;
static GAppInfo *help_app_info = NULL;
+#endif
GAppInfo *app_info = NULL;
GList *uris_list = NULL;
@@ -193,6 +178,7 @@ _open_uri_for_gnome (const gchar *uri)
if (!uri)
return;
+#ifndef MAC_INTEGRATION
/* Supported network URIs */
if (g_str_has_prefix (uri, "http:") || g_str_has_prefix (uri, "https:"))
{
@@ -210,22 +196,12 @@ _open_uri_for_gnome (const gchar *uri)
app_info = help_app_info;
}
+#endif
uris_list = g_list_append (uris_list, (gchar *) uri);
_open_uris_with_app_info (uris_list, app_info);
g_list_free (uris_list);
}
-#endif
-
-void
-frogr_util_open_uri (const gchar *uri)
-{
-#ifdef MAC_INTEGRATION
- _open_uri_for_mac (uri);
-#else
- _open_uri_for_gnome (uri);
-#endif
-}
void
frogr_util_open_images_in_viewer (GList *uris_list)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]