diff options
| author | Dmitry Zhulanov <dmitry.zhulanov@gmail.com> | 2016-10-01 06:05:10 +0000 |
|---|---|---|
| committer | Dmitry Zhulanov <dmitry.zhulanov@gmail.com> | 2016-10-01 06:05:10 +0000 |
| commit | 81364db0bc98b01319dc5ecb835a4e37b906bad2 (patch) | |
| tree | 405d5268db023f160154240d074f4ba4f5d60136 /src | |
| parent | allow to use verbs as xverbs (diff) | |
| download | inkscape-81364db0bc98b01319dc5ecb835a4e37b906bad2.tar.gz inkscape-81364db0bc98b01319dc5ecb835a4e37b906bad2.zip | |
disable xverb feature if WITH_YAML defined
(bzr r15136.1.9)
Diffstat (limited to 'src')
| -rw-r--r-- | src/main-cmdlinexact.cpp | 10 | ||||
| -rw-r--r-- | src/main.cpp | 15 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/main-cmdlinexact.cpp b/src/main-cmdlinexact.cpp index a3c9436bd..3dc83bc8f 100644 --- a/src/main-cmdlinexact.cpp +++ b/src/main-cmdlinexact.cpp @@ -52,7 +52,10 @@ #include <glibmm/i18n.h> #include "main-cmdlinexact.h" +#ifdef WITH_YAML #include "yaml.h" +#endif // WITH_YAML + #include "extension/system.h" #include "file.h" #include <glib.h> @@ -312,6 +315,9 @@ typedef std::list<verb_info_t> verbs_list_t; void CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) { +#ifndef WITH_YAML + return; +#else // WITH_YAML FILE *fh = fopen(yaml_filename, "r"); if(fh == NULL) { printf("Failed to open file!\n"); @@ -409,7 +415,7 @@ CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) { verb_info_t verb; verb.xverb = true; verb.args = vectorFromString((char *)token.data.scalar.value); - if ((verb.args.size() > 1) && Verb::getbyid((char *)token.data.scalar.value)) + if ((verb.args.size() > 1) && Verb::getbyid((char *)token.data.scalar.value, false)) verb.xverb = false; verbs_list.push_back(verb); } @@ -529,7 +535,7 @@ CmdLineXAction::createActionsFromYAML( gchar const *yaml_filename ) { } fflush(stdout); - return; +#endif // WITH_YAML } diff --git a/src/main.cpp b/src/main.cpp index d9f11ed8b..5b7dcc5ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -229,8 +229,10 @@ static gchar *sp_export_png_utf8 = NULL; static gchar *sp_export_svg_utf8 = NULL; static gchar *sp_global_printer_utf8 = NULL; +#ifdef WITH_YAML static gchar *sp_xverbs_yaml_utf8 = NULL; static gchar *sp_xverbs_yaml = NULL; +#endif // WITH_YAML /** @@ -305,12 +307,12 @@ struct poptOption options[] = { POPT_ARG_STRING, NULL, SP_ARG_FILE, N_("Open specified document(s) (option string may be excluded)"), N_("FILENAME")}, - - {"xverbs", 'B', +#ifdef WITH_YAML + {"xverbs", 0, POPT_ARG_STRING, &sp_xverbs_yaml, SP_ARG_XVERBS, N_("xverbs command"), N_("XVERBS_FILENAME")}, - +#endif // WITH_YAML {"print", 'p', POPT_ARG_STRING, &sp_global_printer, SP_ARG_PRINT, N_("Print document(s) to specified output file (use '| program' for pipe)"), @@ -891,7 +893,9 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) fixupSingleFilename( &sp_export_png, &sp_export_png_utf8 ); fixupSingleFilename( &sp_export_svg, &sp_export_svg_utf8 ); fixupSingleFilename( &sp_global_printer, &sp_global_printer_utf8 ); +#ifdef WITH_YAML fixupSingleFilename( &sp_xverbs_yaml, &sp_xverbs_yaml_utf8 ); +#endif // WITH_YAML } else { @@ -901,9 +905,10 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest ) sp_export_svg_utf8 = g_strdup( sp_export_svg ); if ( sp_global_printer ) sp_global_printer_utf8 = g_strdup( sp_global_printer ); +#ifdef WITH_YAML if ( sp_xverbs_yaml ) sp_xverbs_yaml_utf8 = g_strdup( sp_xverbs_yaml ); - +#endif // WITH_YAML } #ifdef WITH_DBUS @@ -2145,6 +2150,7 @@ sp_process_args(poptContext ctx) } break; } +#ifdef WITH_YAML case SP_ARG_XVERBS: { gchar const *fn = poptGetOptArg(ctx); if (fn != NULL) { @@ -2153,6 +2159,7 @@ sp_process_args(poptContext ctx) } break; } +#endif // WITH_YAML case SP_ARG_VERSION: { printf("Inkscape %s (%s)\n", Inkscape::version_string, __DATE__); exit(0); |
