[gtk/inspector-work: 2/2] inspector: Disable autoloaded custom css initially



commit a0e635366794a3612f29bea0900bb129b537765d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Apr 6 23:08:10 2019 +0000

    inspector: Disable autoloaded custom css initially
    
    This is a safeguard against possible crashing css
    being autoloaded.

 gtk/inspector/css-editor.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c
index 630f27f36f..d8d11efa9e 100644
--- a/gtk/inspector/css-editor.c
+++ b/gtk/inspector/css-editor.c
@@ -119,8 +119,9 @@ set_initial_text (GtkInspectorCssEditor *ce)
 
   autosave_file = get_autosave_path ();
 
-  g_file_get_contents (autosave_file, &initial_text, &len, NULL);
-  if (!initial_text)
+  if (g_file_get_contents (autosave_file, &initial_text, &len, NULL))
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ce->priv->disable_button), TRUE);
+  else
     initial_text = g_strconcat ("/*\n",
                                 _("You can type here any CSS rule recognized by GTK."), "\n",
                                 _("You can temporarily disable this custom CSS by clicking on the “Pause” 
button above."), "\n\n",


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