[gnome-sound-recorder/resources] application: fix issues related to bundling css into gresource



commit 99f2e9577440b1d2ef550e0d0c74d79d74b91d61
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Thu May 2 23:57:59 2019 +0200

    application: fix issues related to bundling css into gresource
    
    those issues were introduced in !16
    - the pkgdatadir should use app-id = pkg.name
    - Fix loading gresource

 data/meson.build   | 2 +-
 meson.build        | 2 +-
 src/application.js | 5 +++--
 src/meson.build    | 4 ++--
 4 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index fc0fedc..abee44d 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -45,7 +45,7 @@ gnome.compile_resources(
   application_id + '.data',
   application_id + '.data.gresource.xml',
   gresource_bundle: true,
-  install_dir: sound_recoder_pkgdatadir,
+  install_dir: sound_recorder_pkgdatadir,
   install: true
 )
 
diff --git a/meson.build b/meson.build
index 4f2dfbc..31e284c 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,7 @@ sound_recorder_prefix = get_option('prefix')
 sound_recorder_bindir = join_paths(sound_recorder_prefix, get_option('bindir'))
 sound_recorder_libdir = join_paths(sound_recorder_prefix, get_option('libdir'))
 sound_recorder_datadir = join_paths(sound_recorder_prefix, get_option('datadir'))
-sound_recoder_pkgdatadir = join_paths(sound_recorder_datadir, meson.project_name())
+sound_recorder_pkgdatadir = join_paths(sound_recorder_datadir, application_id)
 
 sound_recorder_schemadir = join_paths(sound_recorder_datadir, 'glib-2.0', 'schemas')
 
diff --git a/src/application.js b/src/application.js
index 981ac40..587bb1d 100644
--- a/src/application.js
+++ b/src/application.js
@@ -23,6 +23,7 @@ const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const Gst = imports.gi.Gst;
 const Gtk = imports.gi.Gtk;
+const Gdk = imports.gi.Gdk;
 
 const MainWindow = imports.mainWindow;
 const Preferences = imports.preferences;
@@ -141,11 +142,11 @@ var Application = GObject.registerClass(class Application extends Gtk.Applicatio
 
     _loadStyleSheet() {
         let provider = new Gtk.CssProvider();
-        provider.load_from_resource('resource:///org/gnome/SoundRecorder/application.css');
+        provider.load_from_resource('/org/gnome/SoundRecorder/application.css');
         Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
                                                  provider,
                                                  Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
-    },
+    }
 
     _showAbout() {
         let aboutDialog = new Gtk.AboutDialog();
diff --git a/src/meson.build b/src/meson.build
index 395c6d2..8936a05 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -9,7 +9,7 @@ configure_file(
   input: 'org.gnome.SoundRecorder.in',
   output: application_id,
   install: true,
-  install_dir: sound_recoder_pkgdatadir,
+  install_dir: sound_recorder_pkgdatadir,
   configuration: app_conf
 )
 
@@ -19,5 +19,5 @@ gnome.compile_resources(
   source_dir: '.',
   gresource_bundle: true,
   install: true,
-  install_dir: sound_recoder_pkgdatadir
+  install_dir: sound_recorder_pkgdatadir
 )


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