Adjust the comment about QFileInfo::operator==().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28859 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-03-18 22:49:11 +00:00
parent 22e1e85c8e
commit 1a94a63db8

View File

@ -921,6 +921,12 @@ docstring const FileName::relPath(string const & path) const
}
// Note: According to Qt, QFileInfo::operator== is undefined when
// both files do not exist (Qt4.5 gives true for all non-existent
// files, while Qt4.4 compares the filenames).
// see:
// http://www.qtsoftware.com/developer/task-tracker/
// index_html?id=248471&method=entry.
bool operator==(FileName const & l, FileName const & r)
{
// FIXME: In future use Qt.
@ -944,9 +950,8 @@ bool operator==(FileName const & l, FileName const & r)
if (!lhs.d->fi.isSymLink() && !rhs.d->fi.isSymLink()) {
// Qt already checks if the filesystem is case sensitive or not.
return lhs.d->fi == rhs.d->fi
// This is needed as in Qt4.5, QFileInfo::operator== compares
// the location of the two files and not the files themselves.
// see note above why the extra check with fileName is needed.
return lhs.d->fi == rhs.d->fi
&& lhs.d->fi.fileName() == rhs.d->fi.fileName();
}
@ -957,8 +962,7 @@ bool operator==(FileName const & l, FileName const & r)
QFileInfo fi2(rhs.d->fi);
if (fi2.isSymLink())
fi2 = QFileInfo(fi2.symLinkTarget());
// This is needed as in Qt4.5, QFileInfo::operator== compares
// the location of the two files and not the files themselves.
// see note above why the extra check with fileName is needed.
return fi1 == fi2 && fi1.fileName() == fi2.fileName();
}