diff options
-rw-r--r-- | source/xrmoptions.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/xrmoptions.c b/source/xrmoptions.c index d0bef5c4..f05d4f07 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -232,23 +232,19 @@ static void config_parser_set ( XrmOption *option, char *xrmValue ) static void __config_parse_xresource_options ( xcb_xrm_database_t *xDB ) { const char * namePrefix = "rofi"; - const char * classPrefix = "rofi"; for ( unsigned int i = 0; i < sizeof ( xrmOptions ) / sizeof ( XrmOption ); ++i ) { - char *name, *class; - name = g_strdup_printf ( "%s.%s", namePrefix, xrmOptions[i].name ); - class = g_strdup_printf ( "%s.%s", classPrefix, xrmOptions[i].name ); + char *name = g_strdup_printf ( "%s.%s", namePrefix, xrmOptions[i].name ); char *xrmValue = NULL; - if ( xcb_xrm_resource_get_string ( xDB, name, class, &xrmValue ) == 0 ) { + if ( xcb_xrm_resource_get_string ( xDB, name, NULL, &xrmValue ) == 0 ) { config_parser_set ( &( xrmOptions[i] ), xrmValue ); } if ( xrmValue ) { free ( xrmValue ); } - g_free ( class ); g_free ( name ); } } @@ -337,22 +333,19 @@ void config_parse_cmd_options_dynamic ( void ) static void __config_parse_xresource_options_dynamic ( xcb_xrm_database_t *xDB ) { const char * namePrefix = "rofi"; - const char * classPrefix = "rofi"; for ( unsigned int i = 0; i < num_extra_options; ++i ) { - char *name, *class; + char *name; name = g_strdup_printf ( "%s.%s", namePrefix, extra_options[i].name ); - class = g_strdup_printf ( "%s.%s", classPrefix, extra_options[i].name ); char *xrmValue = NULL; - if ( xcb_xrm_resource_get_string ( xDB, name, class, &xrmValue ) == 0 ) { + if ( xcb_xrm_resource_get_string ( xDB, name, NULL, &xrmValue ) == 0 ) { config_parser_set ( &( extra_options[i] ), xrmValue ); } if ( xrmValue ) { free ( xrmValue ); } - g_free ( class ); g_free ( name ); } } |