summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Schwinn <alexxcons@xfce.org>2020-11-28 00:55:42 +0100
committerAlexander Schwinn <alexxcons@xfce.org>2020-12-02 14:44:45 +0100
commit79ae408252c4043647e17ae5d415c40241bf2afd (patch)
treeded40c9bb33d4aa0792318b71877560c13fd8c48 /plugins
parentc6eb98de4b813f735bcdce932c33e3e48c3d73f4 (diff)
downloadthunar-79ae408252c4043647e17ae5d415c40241bf2afd.tar.gz
Ignore unknown XML elements in UCA.xml
... instead of failing to load all UCA's. This will simplify switching between thunar versions with different UCA elements. (E.g. When a new element will be introduced, like foreseen in Issue #184)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/thunar-uca/thunar-uca-model.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/thunar-uca/thunar-uca-model.c b/plugins/thunar-uca/thunar-uca-model.c
index c57a6f3e..5e24b7a7 100644
--- a/plugins/thunar-uca/thunar-uca-model.c
+++ b/plugins/thunar-uca/thunar-uca-model.c
@@ -86,6 +86,7 @@ typedef enum
PARSER_OTHER_FILES,
PARSER_TEXT_FILES,
PARSER_VIDEO_FILES,
+ PARSER_UNKNOWN_ELEMENT,
} ParserState;
@@ -652,7 +653,7 @@ start_element_handler (GMarkupParseContext *context,
if (strcmp (element_name, "actions") == 0)
xfce_stack_push (parser->stack, PARSER_ACTIONS);
else
- goto unknown_element;
+ xfce_stack_push (parser->stack, PARSER_UNKNOWN_ELEMENT);
break;
case PARSER_ACTIONS:
@@ -671,7 +672,7 @@ start_element_handler (GMarkupParseContext *context,
xfce_stack_push (parser->stack, PARSER_ACTION);
}
else
- goto unknown_element;
+ xfce_stack_push (parser->stack, PARSER_UNKNOWN_ELEMENT);
break;
case PARSER_ACTION:
@@ -789,18 +790,12 @@ start_element_handler (GMarkupParseContext *context,
xfce_stack_push (parser->stack, PARSER_VIDEO_FILES);
}
else
- goto unknown_element;
+ xfce_stack_push (parser->stack, PARSER_UNKNOWN_ELEMENT);
break;
default:
- goto unknown_element;
+ xfce_stack_push (parser->stack, PARSER_UNKNOWN_ELEMENT);
}
-
- return;
-
-unknown_element:
- g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT,
- _("Unknown element <%s>"), element_name);
}
@@ -914,6 +909,10 @@ end_element_handler (GMarkupParseContext *context,
goto unknown_element;
break;
+ case PARSER_UNKNOWN_ELEMENT:
+ g_warning ("Unknown element ignored: <%s>", element_name);
+ break;
+
default:
goto unknown_element;
}