On Monday 15 July 2002 4:45 pm, Jean-Marc Lasgouttes wrote:
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
>
> Angus> I thought I'd address the bug "LyX doesn't update the image on
> Angus> screen if I update the external graphics file".
>
> Angus> I envisage something as simple as (below) but don't know how to
> Angus> check the timestamp of a file. I don't suppose piping `ls -l
> Angus> file` through sed is the way forward!
>
> Angus> Can anybody help?
>
> I guess FileInfo does everything you want. 

Super, JMarc. I guess that this would do the trick:

        FileInfo finfo(file);
        time_t const timestamp = finfo.getModificationTime();
        if (timestamp != stored_timestamp) {
                stored_timestamp = timestamp;
                // reload graphic
                ...

                timer.restart();
        }

> Note however, that other parts of lyx rely on crc instead. You might 
> want to do that same for consistency.

I plead great ignorance. how efficient is crc? Would there not be a big 
performance penalty if I used lyx::sum(file) every time I poled the file? 
(Every couple of seconds...)

Angus

Reply via email to