+ if (conversionflags & try_default) {
+ // if no special converter defined, then we take the
+ // default one from ImageMagic.
+ string const from_ext = from_format.empty() ?
+ getExtension(from_file.absFilename()) :
+ formats.extension(from_format);
+ string const to_ext = formats.extension(to_format);
+ string const command =
+ support::os::python() + ' ' +
+ quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) +
+ ' ' +
+ quoteName(from_ext + ':' + from_file.toFilesystemEncoding()) +
+ ' ' +
+ quoteName(to_ext + ':' + to_file.toFilesystemEncoding());
+ lyxerr[Debug::FILES]
+ << "No converter defined! "
+ "I use convertDefault.py:\n\t"
+ << command << endl;
+ Systemcall one;
+ one.startscript(Systemcall::Wait, command);
+ if (isFileReadable(to_file)) {
+ if (conversionflags & try_cache)
+ ConverterCache::get().add(orig_from,
+ to_format, to_file);
+ return true;
+ }
+ }
+ Alert::error(_("Cannot convert file"),
+ bformat(_("No information for converting %1$s "
+ "format files to %2$s.\n"
+ "Define a converter in the preferences."),
+ from_ascii(from_format), from_ascii(to_format)));