[gnome-text-editor] build: keep style-schemes in private directory



commit a956e39bb00d1d25384be546450338dd141c2c71
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 21 21:32:55 2022 -0800

    build: keep style-schemes in private directory
    
    We don't need to install these to the public directory, instead keep them
    private so we don't collide with any other applications.

 data/styles/meson.build  | 3 ++-
 meson.build              | 1 +
 src/editor-application.c | 8 ++++++--
 3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/data/styles/meson.build b/data/styles/meson.build
index 986a496..431b88e 100644
--- a/data/styles/meson.build
+++ b/data/styles/meson.build
@@ -3,4 +3,5 @@ install_data([
   'builder-dark.xml',
   'peninsula.xml',
   'peninsula-dark.xml',
-], install_dir: join_paths(get_option('datadir'), 'gtksourceview-5/styles'))
+  'printing.xml',
+], install_dir: join_paths(get_option('datadir'), 'gnome-text-editor/styles'))
diff --git a/meson.build b/meson.build
index de4a61b..daccc16 100644
--- a/meson.build
+++ b/meson.build
@@ -59,6 +59,7 @@ config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('lo
 config_h.set_quoted('PACKAGE_WEBSITE', 'https://gitlab.gnome.org/GNOME/gnome-text-editor')
 config_h.set_quoted('PACKAGE_ICON_NAME', app_id)
 config_h.set_quoted('PACKAGE_NAME', 'Text Editor')
+config_h.set_quoted('PACKAGE_DATADIR', join_paths(get_option('prefix'), get_option('datadir'), 
'gnome-text-editor'))
 config_h.set10('DEVELOPMENT_BUILD', get_option('development'))
 
 global_c_args = [
diff --git a/src/editor-application.c b/src/editor-application.c
index 0ccefb4..bf11f63 100644
--- a/src/editor-application.c
+++ b/src/editor-application.c
@@ -279,10 +279,11 @@ static void
 editor_application_startup (GApplication *application)
 {
   static const char *patterns[] = { "org.gnome.*", NULL };
-  static const gchar *quit_accels[] = { "<Primary>Q", NULL };
-  static const gchar *help_accels[] = { "F1", NULL };
+  static const char *quit_accels[] = { "<Primary>Q", NULL };
+  static const char *help_accels[] = { "F1", NULL };
 
   EditorApplication *self = (EditorApplication *)application;
+  GtkSourceStyleSchemeManager *schemes;
   g_autoptr(GtkCssProvider) css_provider = NULL;
   g_autoptr(GVariant) all = NULL;
   AdwStyleManager *style_manager;
@@ -330,6 +331,9 @@ editor_application_startup (GApplication *application)
       parse_portal_settings (self, all);
     }
 
+  schemes = gtk_source_style_scheme_manager_get_default ();
+  gtk_source_style_scheme_manager_append_search_path (schemes, PACKAGE_DATADIR"/styles");
+
   style_manager = adw_style_manager_get_default ();
 
   g_signal_connect_object (style_manager,


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