[gnome-clocks/zbrown/world-clocks: 34/35] general: use load_from_resource instead of faking it with GFile
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/zbrown/world-clocks: 34/35] general: use load_from_resource instead of faking it with GFile
- Date: Sun, 23 Feb 2020 18:18:06 +0000 (UTC)
commit 06144749beef0b02c119b4a50a65e4da1c046722
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]