diff options
author | José Romildo Malaquias <[email protected]> | 2019-12-25 18:48:38 -0300 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-12-27 07:14:52 +0000 |
commit | 0734ed62a91179fa17598e672253ce5718620afc (patch) | |
tree | 3d2c4b967241ddd94f484d56254f1de1513ef27f /capplets/common/mate-theme-info.c | |
parent | ef2f71866bf51f3e778246db789d119af36276d4 (diff) | |
download | mate-control-center-0734ed62a91179fa17598e672253ce5718620afc.tar.bz2 mate-control-center-0734ed62a91179fa17598e672253ce5718620afc.tar.xz |
Search system themes in system data dirs
Diffstat (limited to 'capplets/common/mate-theme-info.c')
-rw-r--r-- | capplets/common/mate-theme-info.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c index 54ae3aea..a738f0b7 100644 --- a/capplets/common/mate-theme-info.c +++ b/capplets/common/mate-theme-info.c @@ -1763,6 +1763,7 @@ mate_theme_color_scheme_equal (const gchar *s1, const gchar *s2) void mate_theme_init () { + const gchar * const * dirs; GFile *top_theme_dir; gchar *top_theme_dir_string; static gboolean initted = FALSE; @@ -1783,13 +1784,16 @@ mate_theme_init () theme_hash_by_uri = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); theme_hash_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - /* Add all the toplevel theme dirs. */ - /* $datadir/themes */ - top_theme_dir_string = gtk_rc_get_theme_dir (); - top_theme_dir = g_file_new_for_path (top_theme_dir_string); - g_free (top_theme_dir_string); - add_top_theme_dir_monitor (top_theme_dir, 1, NULL); - g_object_unref (top_theme_dir); + /* Add all the toplevel theme dirs following the XDG Base Directory Specification */ + dirs = g_get_system_data_dirs (); + if (dirs != NULL) + for (; *dirs != NULL; ++dirs) { + top_theme_dir_string = g_build_filename (*dirs, "themes", NULL); + top_theme_dir = g_file_new_for_path (top_theme_dir_string); + g_free (top_theme_dir_string); + add_top_theme_dir_monitor (top_theme_dir, 1, NULL); + g_object_unref (top_theme_dir); + } /* ~/.themes */ top_theme_dir_string = g_build_filename (g_get_home_dir (), ".themes", NULL); |