>i would like to kill more oooold and unused members, but its hard to
test things because of
>http://www.lyx.org/trac/ticket/6496 .
>
>Abdel would it be possible to look on the cache metrics stuff; maybe
its just oneliner for you?
>

It's probably my 'fault'. The problem is that loadLyXFile calls
setReadonly which issues a repaint (with changed(false)). However,
because we are in a reload event, we have to update the metrics and so
we should call "changed(true)", which is done later on, but after the
setReadonly.

I think we should not issue a repaint from the internals of the Buffer
class. 

I propose the following patch:

bool Buffer::loadLyXFile(FileName const & s)
{
        // If the file is not readable, we try to
        // retrieve the file from version control.
        if (!s.isReadableFile()
                  && !LyXVC::file_not_found_hook(s))
                return false;

        if (s.isReadableFile()
                  && readFileHelper(s)) {
                lyxvc().file_found_hook(s);
-               setReadonly(!s.isWritable());
+               d->read_only = !s.isWritable();
                return true;
        }
        return false;
}


>pavel

Does this solve it (I can't test right now).

Vincent

Reply via email to