[Xfce4-commits] <ristretto:master> Simplify launch_help

Stephan Arts noreply at xfce.org
Sun Jan 8 13:30:02 CET 2012


Updating branch refs/heads/master
         to aa74058f8c7b53fcb0ef4956c8d7f2ec4aee4242 (commit)
       from 30031ef8f300ee2e6b8a1df2ab18fdcbe6328949 (commit)

commit aa74058f8c7b53fcb0ef4956c8d7f2ec4aee4242
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Jan 8 13:28:59 2012 +0100

    Simplify launch_help

 src/util.c |   64 +-----------------------------------------------------------
 1 files changed, 1 insertions(+), 63 deletions(-)

diff --git a/src/util.c b/src/util.c
index 1a3c8a2..a2afd8b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -26,70 +26,8 @@
 gboolean
 rstto_launch_help (void)
 {
-    gchar *locale = NULL;
-    gchar *offset;
-    gchar *docpath = NULL;
     gchar *cur_dir = g_get_current_dir();
-  
-    /* Find localized documentation path on disk */
-#ifdef ENABLE_NLS
-#ifdef HAVE_LOCALE_H
-    locale = g_strdup (setlocale (LC_MESSAGES, ""));
-    if (locale != NULL)
-    {
-        offset = g_strrstr (locale, ".");
-        if (offset != NULL)
-        {
-            *offset = '\0';
-        }
-    }
-    else
-    {
-        locale = g_strdup ("C");
-    }
-#else
-    locale = g_strdup ("C");
-#endif
-
-    docpath = g_strdup_printf (DOCDIR"/html/%s/index.html", locale);
-    if (!g_file_test (docpath, G_FILE_TEST_EXISTS))
-    {
-        offset = g_strrstr (locale, "_");
-        if (offset == NULL)
-        {
-            g_free (docpath);
-            docpath = g_strdup (DOCDIR"/html/C/index.html");
-        }
-        else
-        {
-            *offset = '\0';
-            g_free (docpath);
-            docpath = g_strdup_printf (DOCDIR"/html/%s/index.html", locale);
-            if (!g_file_test (docpath, G_FILE_TEST_EXISTS))
-            {
-                g_free (docpath);
-                docpath = g_strdup (DOCDIR"/html/C/index.html");
-            }
-        }
-    }
-
-    g_free (locale);
-#else
-    docpath = g_strdup (DOCDIR"/html/C/index.html");
-#endif
-
-    /* Revert to online documentation if not available on disk */
-    if (g_file_test (docpath, G_FILE_TEST_EXISTS))
-    {
-        gchar *tmp = docpath;
-        docpath = g_strdup_printf ("file://%s", docpath);
-        g_free (tmp);
-    }
-    else
-    {
-        g_free (docpath);
-        docpath = g_strdup("http://docs.xfce.org/apps/ristretto");
-    }
+    gchar *docpath = g_strdup("http://docs.xfce.org/apps/ristretto");
 
     if (FALSE == exo_execute_preferred_application (
             "WebBrowser",


More information about the Xfce4-commits mailing list