Mael Hilléreau wrote:
Le 27 juin 07 à 13:21, Abdelrazak Younes a écrit :
Mael Hilléreau wrote:
Great! BTW, do you have an opinion (better, an explanation) on
whether it is needed to perform a CRC for graphics? I'm referring to
a previous discussion entitled "Converter problem with Mac OS
packages" (http://marc.info/?t=118019789300008&r=1&w=4). Besides,
nobody answered to my last message on this topic:
http://marc.info/?l=lyx-devel&m=118138743205598&w=4
I don't have a strong opinion on that. I suppose we should first try
the timestamp based solution and evolves to a CRC based solution if
ever needed (and my guess is never).
Could you please recap the problem, the above thread is way too long
for my taste ;-)
;) Well, ... I would say:
A. The goal: we would like to support MacOS packages (which are actually
directories) as graphic files (e.g. Omnigraffle uses such packages).
Despite this is currently a MacOS issue, JMarc said that it could be
useful to accept directories as graphics for other OSes as well.
Even if this won't happen probably, I agree that this code should
compile for all platforms. On second thought maybe this directory
checking could be used for the html export...
B. I proposed a patch which does the job, but in which cache update is
only led by comparing directories' timestamps.
Could you post it again agains latest SVN?
C. Andre and JMarc think that it would be better to use a timestamp+CRC
solution, and not me. I argue that a CRC isn't relevant for graphics. My
message of June, the 9th
(http://marc.info/?l=lyx-devel&m=118138743205598&w=4) recaps those
different possibilities and explains my ideas.
Now, there are two issues:
1. Regarding B.: before adopting this patch, should the code be enclosed
into #ifdefs? If yes, what kind of #ifdefs: IS_MACOS,
HAVE_GRAPHICS_DIR... and where to introduce them?
No #ifdef IMO, unless really necessary. If you use Qt4.3 specific code
(QFileInfo::isBundle()), then this is necessary and the test should be
on the Qt version.
Note also that the
patch preserves CRC+timestamp for regular files.
Good.
2. Regarding C.: there was certainly a motivation for introducing the
CRC for regular files, but nobody explained it deeply. So who did
introduce the CRC test, and why?
AFAIU, the CRC based solution is required for files generated during
latex compilation. It could happens that a same file is recompiled twice
or more within a second.
For graphics that are not generated by LyX itself, I agree that the CRC
checking is not necessary. So the distinction should be be upon the
origin of the file, not on its type: LyX generated or not?
Hopefully, my way wasn't too long for your taste ;-)
It was perfect :-)
Abdel.