[gjs] Gtk: Scrub resource:// prefix for template path



commit 5c84dc06e38a5ef4c3b58978e1e1f973b99f0049
Author: Jonas Danielsson <jonas danielsson threetimestwo org>
Date:   Thu Nov 6 09:17:53 2014 -0500

    Gtk: Scrub resource:// prefix for template path
    
    Gtk.Widget.bind_template_child_full expects an absolute path to the
    resource. We need to scrub the resource:// part of the template string.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739739

 modules/overrides/Gtk.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/modules/overrides/Gtk.js b/modules/overrides/Gtk.js
index 9b7d891..8a23977 100644
--- a/modules/overrides/Gtk.js
+++ b/modules/overrides/Gtk.js
@@ -51,7 +51,7 @@ const GtkWidgetClass = new Lang.Class({
         if (template) {
             if (typeof template == 'string' &&
                 template.startsWith('resource:///'))
-                Gtk.Widget.set_template_from_resource.call(this, template);
+                Gtk.Widget.set_template_from_resource.call(this, template.slice(11));
             else
                 Gtk.Widget.set_template.call(this, template);
         }


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