Le 26 mai 07 à 18:31, Mael Hilléreau a écrit :
Would it be possible to enable the MacOS version of LyX to work
with graphics stored as MacOS packages? I mean would it be possible
to replace the kind of "test -f $$i" by a kind of "test -r $$i" in
order to check for folders too?
I found in the source (LyX 1.4.4) the function call (file
converter.C, line 313):
bool Converters::convert(Buffer const * buffer,
string const & from_file, string const & to_file_base,
string const & from_format, string const & to_format,
string & to_file, bool try_default)
{
...
if (IsFileReadable(to_file)) {
return true;
...
}
Indeed, this function is defined as (fileTools.c, line 159):
// Is a file readable ?
bool IsFileReadable(string const & path)
{
return fs::exists(path) && !fs::is_directory(path) && fs::is_readable
(path);
}
A short (and bad) fix would be to remove the "!fs::is_directory
(path)" clause for the Mac OS version. But there's surely a way to
check only for directories corresponding to packages. As I don't know
Mac OS programming, does anybody have a clue?
Mael.
--
Mael Hilléreau
http://mael.hillereau.free.fr