I thought I'd address the bug "LyX doesn't update the image on screen if I 
update the external graphics file".

I envisage something as simple as (below) but don't know how to check the 
timestamp of a file. I don't suppose piping `ls -l file` through sed is the 
way forward!

Can anybody help?

Angus

Timeout timer(2000);
timer.timeout.connect(boost::bind(&GraphicsCacheItem::checkStatus, this));
        
void GraphicsCacheItem::checkStatus()
{
        if (!isFileReadable(file)) {
                // file has been erased. Do nothing.
                return;
        }

        int const timestamp = getTimestamp(file);
        if (timestamp != stored_timestamp) {
                stored_timestamp = timestamp;
                // load graphics file into memory once again.
                ...

                timer.restart();
        }
}

Reply via email to