-----Original Message----- From: rgheck [mailto:rgh...@bobjweil.com] Sent: donderdag 19 maart 2009 20:46 To: Vincent van Ravesteijn - TNW Cc: lyx-devel@lists.lyx.org Subject: Re: LyX 1.6.2: possible performance issue inside master document
Vincent van Ravesteijn - TNW wrote: > > rgheck wrote: > >>>> By the way, can you remember what problem Bennet had which made you >>>> adding the lhs.refresh() and rhs.refresh() lines to >>>> FileName::operator==(). This solution looks a bit like "Abdel's >>>> > hammer". > >>>> >>>> >>> Not right now, no, though it's probably on the list somewhere. But I >>> think the problem was that, when caching is enabled, the file could >>> have moved, been deleted, etc, and you'll miss it without a refresh. >>> >>> >> http://marc.info/?l=lyx-devel&m=121734075326705&w=2 >> >> rh >> >> > > The thread starts with a problem that would be the consequence of > r25960. > > I don't see why refreshing is a solution for a problem that could have > been introduces in r25960. The thread neither gives an answer why and > whether the changes are correct. > > >The previous == and != checks had just been against the file NAMES, which meant you could get file1 != file2, >if the names were symlinks pointing to the same file, and names with different capatalizations would be seen >as different on Windows, VFAT, etc. So Abdel changed it to call QFileInfo::operator==, which dealt with both >problems. But that led to Bennett's problem: The comparison sometimes rested on old data; hence the need for >the refresh. > The old way of checking the file NAMES would also have been based on 'old' data or not ? That's what I don't understand, was it like this: A file should be copied when the target fileNAME was different from the source fileNAME ? When changing to the ==() operator, we checked whether the two files are both existent and have exactly the same name and _size_ (that is used in QFileInfo::operator==()). Thus if one of the two objects has a cached value that the file did not exist and the other (a new FileName object) says the file does exist. ==() returns false for the two files. Then copying a file onto itself will fail. But this shows an example in which it is of _no_ interest whether the files are exactly the same. It is only of interest to know whether the path is the same, so QFileInfo::==() should not be used. Does this make sense ? >rh Vincent