diff options
author | Michael Meeks <michael.meeks@novell.com> | 2010-03-24 17:56:20 +0800 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-03-24 17:56:20 +0800 |
commit | 077c7326355dd2881e3a4686ccdf4c2a7446df4f (patch) | |
tree | 9c078555394d710e44605524d8492606f6eced2d /e-util | |
parent | 214456fd1524029de814281270c46106ff9aa883 (diff) | |
download | gsoc2013-evolution-077c7326355dd2881e3a4686ccdf4c2a7446df4f.tar.gz gsoc2013-evolution-077c7326355dd2881e3a4686ccdf4c2a7446df4f.tar.zst gsoc2013-evolution-077c7326355dd2881e3a4686ccdf4c2a7446df4f.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.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c index d7c249af06..8c7455a054 100644 --- a/e-util/e-ui-manager.c +++ b/e-util/e-ui-manager.c @@ -97,24 +97,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'; |