[Xfce4-commits] <midori:master> Look for user documentation dynamically on win32

Christian Dywan noreply at xfce.org
Tue Feb 16 01:04:06 CET 2010


Updating branch refs/heads/master
         to 4774e35932f94e6787c1b37dc56e83950d63e876 (commit)
       from c90344ac4420405bf0476a9ddd26d5ae525f1f60 (commit)

commit 4774e35932f94e6787c1b37dc56e83950d63e876
Author: Peter de Ridder <peter at xfce.org>
Date:   Tue Feb 16 00:47:11 2010 +0100

    Look for user documentation dynamically on win32

 midori/midori-browser.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 6dd0d7b..1bbd49f 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -4857,15 +4857,37 @@ _action_help_link_activate (GtkAction*     action,
     const gchar* action_name;
     const gchar* uri;
     gint n;
+    #if defined (G_OS_WIN32) && defined (DOCDIR)
+    gchar* free_uri = NULL;
+    #endif
 
     action_name = gtk_action_get_name (action);
     if  (!strncmp ("HelpContents", action_name, 12))
     {
+        #ifdef G_OS_WIN32
+        {
+            #ifdef DOCDIR
+            gchar* path = sokoke_find_data_filename ("doc/midori/user/midori.html");
+            uri = free_uri = g_filename_to_uri (path, NULL, NULL);
+            if (g_access (path, F_OK) != 0)
+            {
+                if (g_access (DOCDIR "/midori/user/midori.html", F_OK) == 0)
+                    uri = "file://" DOCDIR "/midori/user/midori.html";
+                else
+            #endif
+                    uri = "error:nodocs share/doc/midori/user/midori.html";
+            #ifdef DOCDIR
+            }
+            g_free (path);
+            #endif
+        }
+        #else
         #ifdef DOCDIR
         uri = "file://" DOCDIR "/midori/user/midori.html";
         if (g_access (DOCDIR "/midori/user/midori.html", F_OK) != 0)
         #endif
             uri = "error:nodocs " DOCDIR "/midori/user/midori.html";
+        #endif
     }
     else if  (!strncmp ("HelpFAQ", action_name, 7))
         uri = "http://wiki.xfce.org/_export/xhtml/midori_faq";
@@ -4878,8 +4900,11 @@ _action_help_link_activate (GtkAction*     action,
     {
         n = midori_browser_add_uri (browser, uri);
         midori_browser_set_current_page (browser, n);
-    }
 
+        #if defined (G_OS_WIN32) && defined (DOCDIR)
+        g_free (free_uri);
+        #endif
+    }
 }
 
 static void



More information about the Xfce4-commits mailing list