1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00

Improve error messages when type does not match.

This commit is contained in:
Dave Davenport 2017-04-09 15:27:23 +02:00
parent b227fece10
commit 79c33cfca6
3 changed files with 34 additions and 5 deletions

View file

@ -89,6 +89,7 @@ typedef enum
P_HIGHLIGHT,
} PropertyType;
/**
* Represent the color in theme.
*/

View file

@ -82,11 +82,11 @@ int yylex (YYSTYPE *, YYLTYPE *);
%token <sval> T_LINK
%token <sval> FIRST_NAME
%token BOPEN "bracket open"
%token BCLOSE "bracket close"
%token PSEP "property separator"
%token PCLOSE "property close"
%token NSEP "Name separator"
%token BOPEN "bracket open ('{')"
%token BCLOSE "bracket close ('}')"
%token PSEP "property separator (':')"
%token PCLOSE "property close (';')"
%token NSEP "Name separator (' ' or '.')"
%token NAME_PREFIX "Element section ('# {name} { ... }')"
%token WHITESPACE "White space"
%token PDEFAULTS "Default settings section ( '* { ... }')"

View file

@ -13,6 +13,29 @@
/** Logging domain for theme */
#define LOG_DOMAIN "Theme"
/**
* Name of the property type
*/
const char *PropertyTypeName[] = {
/** Integer */
"Integer",
/** Double */
"Double",
/** String */
"String",
/** Boolean */
"Boolean",
/** Color */
"Color",
/** Padding */
"Padding",
/** Link to global setting */
"Reference",
/** Position */
"Position",
/** Highlight */
"Highlight",
};
void yyerror ( YYLTYPE *ylloc, const char *, const char * );
static gboolean distance_compare ( Distance d, Distance e )
{
@ -395,6 +418,11 @@ Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, con
if ( p->type == P_INTEGER && type == P_PADDING ) {
return p;
}
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Found property: '%s' on '%s', but type %s does not match expected type %s.",
property, widget->name,
PropertyTypeName[p->type],
PropertyTypeName[type]
);
}
if ( exact ) {
return NULL;