[gnome-clocks/zbrown/world-clocks] general: use load_from_resource instead of faking it with GFile



commit 26d28b26e9312a5606a94a84e6d388f196da02d7
Author: Zander Brown <zbrown gnome org>
Date:   Sun Feb 23 17:56:11 2020 +0000

    general: use load_from_resource instead of faking it with GFile

 src/utils.vala | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
---
diff --git a/src/utils.vala b/src/utils.vala
index 51d213d..1da4e35 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -38,16 +38,7 @@ namespace Utils {
 
 private void load_css (string css, bool required) {
     var provider = new Gtk.CssProvider ();
-    try {
-        var file = File.new_for_uri ("resource:///org/gnome/clocks/css/" + css + ".css");
-        provider.load_from_file (file);
-    } catch (Error e) {
-        if (required) {
-            warning ("loading css: %s", e.message);
-        }
-
-        return;
-    }
+    provider.load_from_resource ("/org/gnome/clocks/css/" + css + ".css");
 
     Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (),
                                               provider,


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