[gnome-builder/gnome-builder-3-28] help: always use file:// URI for local files



commit 24152b1c13340bb3ced94a74c25f8aa4ee79f852
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 16 11:47:05 2018 -0700

    help: always use file:// URI for local files

 src/libide/application/ide-application-actions.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/libide/application/ide-application-actions.c 
b/src/libide/application/ide-application-actions.c
index e2860359c..d9c21fee4 100644
--- a/src/libide/application/ide-application-actions.c
+++ b/src/libide/application/ide-application-actions.c
@@ -194,14 +194,16 @@ ide_application_actions_help_cb (GObject      *object,
    */
   if (g_file_test (PACKAGE_DOCDIR"/en/index.html", G_FILE_TEST_IS_REGULAR))
     {
-      const gchar *uri;
-      g_autofree gchar *real_uri = NULL;
+      g_autofree gchar *file_base = NULL;
+      g_autofree gchar *uri = NULL;
       g_autoptr(GError) error = NULL;
 
       if (ide_is_flatpak ())
-        uri = real_uri = ide_flatpak_get_app_path ("/share/doc/gnome-builder/en/index.html");
+        file_base = ide_flatpak_get_app_path ("/share/doc/gnome-builder");
       else
-        uri = "file://"PACKAGE_DOCDIR"/en/index.html";
+        file_base = g_strdup (PACKAGE_DOCDIR);
+
+      uri = g_strdup_printf ("file://%s/en/index.html", file_base);
 
       if (!gtk_show_uri_on_window (focused_window, uri, gtk_get_current_event_time (), &error))
         g_warning ("Failed to load documentation: %s", error->message);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]