diff options
author | zhuyaliang <[email protected]> | 2023-10-23 16:47:38 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-10-25 12:19:43 +0200 |
commit | b1331ef7978fdaa11049d9958e4ed279103af570 (patch) | |
tree | 68baf5f0170d14bf3cf13a4665ccc351a4f59635 /capplets/common/gtkrc-utils.c | |
parent | 1a837ccdb078c0021588809814bfa80641acc3a8 (diff) | |
download | mate-control-center-b1331ef7978fdaa11049d9958e4ed279103af570.tar.bz2 mate-control-center-b1331ef7978fdaa11049d9958e4ed279103af570.tar.xz |
common: Fix compilation warnings replace deprecated functions gtk_rc_get_theme_dir and gtk_rc_scanner_new
Diffstat (limited to 'capplets/common/gtkrc-utils.c')
-rw-r--r-- | capplets/common/gtkrc-utils.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/capplets/common/gtkrc-utils.c b/capplets/common/gtkrc-utils.c index 4b5ac0e1..2fac2e93 100644 --- a/capplets/common/gtkrc-utils.c +++ b/capplets/common/gtkrc-utils.c @@ -176,6 +176,51 @@ void gtkrc_get_details(gchar* filename, GSList** engines, GSList** symbolic_colo g_scanner_destroy (scanner); } +static const GScannerConfig gtk_rc_scanner_config = +{ + ( + " \t\r\n" + ) /* cset_skip_characters */, + ( + "_" + G_CSET_a_2_z + G_CSET_A_2_Z + ) /* cset_identifier_first */, + ( + G_CSET_DIGITS + "-_" + G_CSET_a_2_z + G_CSET_A_2_Z + ) /* cset_identifier_nth */, + ( "#\n" ) /* cpair_comment_single */, + + TRUE /* case_sensitive */, + + TRUE /* skip_comment_multi */, + TRUE /* skip_comment_single */, + TRUE /* scan_comment_multi */, + TRUE /* scan_identifier */, + FALSE /* scan_identifier_1char */, + FALSE /* scan_identifier_NULL */, + TRUE /* scan_symbols */, + TRUE /* scan_binary */, + TRUE /* scan_octal */, + TRUE /* scan_float */, + TRUE /* scan_hex */, + TRUE /* scan_hex_dollar */, + TRUE /* scan_string_sq */, + TRUE /* scan_string_dq */, + TRUE /* numbers_2_int */, + FALSE /* int_2_float */, + FALSE /* identifier_2_string */, + TRUE /* char_2_token */, + TRUE /* symbol_2_token */, + FALSE /* scope_0_fallback */, + FALSE /* store_int64 */, + + 0 /* < private > padding_dummy*/, +}; + gchar * gtkrc_get_color_scheme (const gchar *gtkrc_file) { @@ -184,7 +229,7 @@ gtkrc_get_color_scheme (const gchar *gtkrc_file) GSList *files = NULL; GSList *read_files = NULL; GTokenType token; - GScanner *scanner = gtk_rc_scanner_new (); + GScanner *scanner = g_scanner_new (>k_rc_scanner_config); g_scanner_scope_add_symbol (scanner, 0, "include", INCLUDE_SYMBOL); g_scanner_scope_add_symbol (scanner, 0, "gtk_color_scheme", COLOR_SCHEME_SYMBOL); |