aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-03-23 18:24:31 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-03-23 18:25:54 +0800
commit495f8f8003ac98ab63fa68aa89fbe8668c357320 (patch)
tree6ac8d78a53803cc722a79f30f93986599371345d /e-util
parentf794e6a0032c9cee5ffb00eeefb8dc92662742de (diff)
downloadgsoc2013-evolution-495f8f8003ac98ab63fa68aa89fbe8668c357320.tar.gz
gsoc2013-evolution-495f8f8003ac98ab63fa68aa89fbe8668c357320.tar.zst
gsoc2013-evolution-495f8f8003ac98ab63fa68aa89fbe8668c357320.zip
Alter UI conditional syntax to be more familiar cpp style, which
avoids the need for intltool changes.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-ui-manager.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c
index 4086707e81..f108cd37c5 100644
--- a/e-util/e-ui-manager.c
+++ b/e-util/e-ui-manager.c
@@ -106,24 +106,23 @@ ui_manager_filter_ui (EUIManager *ui_manager,
express_mode = e_ui_manager_get_express_mode (ui_manager);
/*
- * Very simple line based pre-processing based on comments:
- * <!-- if [!]EXPRESS -->\n ... \n<!-- endif -->\n
+ * Very simple C style pre-processing in-line in the XML:
+ * #if [!]EXPRESS\n ... \n#endif\n
*/
-
lines = g_strsplit (ui_definition, "\n", -1);
for (ii = 0; lines[ii] != NULL; ii++) {
- gchar *cp;
-
- if ((cp = strstr (lines[ii], "<!-- if "))) {
- gboolean not_express = lines[ii][8] == '!';
- include = express_mode ^ not_express;
- lines[ii][0] = '\0';
- in_conditional = TRUE;
- } else if ((cp = strstr (lines[ii], "<!-- endif"))) {
- lines[ii][0] = '\0';
- include = TRUE;
- in_conditional = FALSE;
+ if (lines[ii][0] == '#') {
+ if (!strncmp (lines[ii], "#if ", 4)) {
+ gboolean not_express = lines[ii][4] == '!';
+ include = express_mode ^ not_express;
+ lines[ii][0] = '\0';
+ in_conditional = TRUE;
+ } else if (!strncmp (lines[ii], "#endif", 6)) {
+ lines[ii][0] = '\0';
+ include = TRUE;
+ in_conditional = FALSE;
+ }
}
if (!include)
lines[ii][0] = '\0';