[epiphany] Fix: User stylesheet is broken when not running in flatpak



commit 553481a3262d560e1bdc1a93f13ed43cf35a3b3f
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Wed Jan 30 22:10:33 2019 +0100

    Fix: User stylesheet is broken when not running in flatpak
    
    Create css file if not present before opening an editor
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/636

 src/prefs-dialog.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index a2438ae11..eb954e729 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1091,8 +1091,12 @@ css_file_created_cb (GObject      *source,
   stream = g_file_create_finish (file, result, &error);
   if (stream == NULL && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
     g_warning ("Failed to create %s: %s", g_file_get_path (file), error->message);
-  else
-    ephy_open_file_via_flatpak_portal (g_file_get_path (file), NULL, css_file_opened_cb, NULL);
+  else {
+    if (ephy_is_running_inside_flatpak ())
+      ephy_open_file_via_flatpak_portal (g_file_get_path (file), NULL, css_file_opened_cb, NULL);
+    else
+      ephy_file_launch_handler (file, gtk_get_current_event_time ());
+  }
 
   if (error != NULL)
     g_error_free (error);
@@ -1111,12 +1115,7 @@ css_edit_button_clicked_cb (GtkWidget   *button,
                                                     USER_STYLESHEET_FILENAME,
                                                     NULL));
 
-  if (ephy_is_running_inside_flatpak ()) {
-    g_file_create_async (css_file, G_FILE_CREATE_NONE, G_PRIORITY_DEFAULT, NULL, css_file_created_cb, NULL);
-  } else {
-    ephy_file_launch_handler (css_file, gtk_get_current_event_time ());
-    g_object_unref (css_file);
-  }
+  g_file_create_async (css_file, G_FILE_CREATE_NONE, G_PRIORITY_DEFAULT, NULL, css_file_created_cb, NULL);
 }
 
 static void


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