mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-08 18:19:42 +00:00
Fix an infinite loop with Qt4.5 when creating two unnamed files.
In Qt4.5, QFileInfo::operator==() always returns true when comparing two non-existing files. Therefore, an extra check is needed. see http://www.lyx.org/trac/changeset/28748 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@28768 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7238dc91e8
commit
9ad1428486
2
ANNOUNCE
2
ANNOUNCE
@ -269,6 +269,8 @@ What's new in version 1.6.2?
|
|||||||
|
|
||||||
- Fix the use of regular expressions to avoid crashes with Qt4.5.
|
- Fix the use of regular expressions to avoid crashes with Qt4.5.
|
||||||
|
|
||||||
|
- Fix an infinite loop when creating multiple unnamed files with Qt4.5.
|
||||||
|
|
||||||
- Ignore the master_buffer setting in Document>Settings if the current
|
- Ignore the master_buffer setting in Document>Settings if the current
|
||||||
document is no real child. This fixes a crash when using the outliner
|
document is no real child. This fixes a crash when using the outliner
|
||||||
in such files (bug 5653).
|
in such files (bug 5653).
|
||||||
|
@ -944,7 +944,10 @@ bool operator==(FileName const & l, FileName const & r)
|
|||||||
|
|
||||||
if (!lhs.d->fi.isSymLink() && !rhs.d->fi.isSymLink()) {
|
if (!lhs.d->fi.isSymLink() && !rhs.d->fi.isSymLink()) {
|
||||||
// Qt already checks if the filesystem is case sensitive or not.
|
// Qt already checks if the filesystem is case sensitive or not.
|
||||||
return lhs.d->fi == rhs.d->fi;
|
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.
|
||||||
|
&& lhs.d->fi.fileName() == rhs.d->fi.fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: When/if QFileInfo support symlink comparison, remove this code.
|
// FIXME: When/if QFileInfo support symlink comparison, remove this code.
|
||||||
@ -954,7 +957,9 @@ bool operator==(FileName const & l, FileName const & r)
|
|||||||
QFileInfo fi2(rhs.d->fi);
|
QFileInfo fi2(rhs.d->fi);
|
||||||
if (fi2.isSymLink())
|
if (fi2.isSymLink())
|
||||||
fi2 = QFileInfo(fi2.symLinkTarget());
|
fi2 = QFileInfo(fi2.symLinkTarget());
|
||||||
return fi1 == fi2;
|
// This is needed as in Qt4.5, QFileInfo::operator== compares
|
||||||
|
// the location of the two files and not the files themselves.
|
||||||
|
return fi1 == fi2 && fi1.fileName() == fi2.fileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,6 +213,8 @@ What's new
|
|||||||
|
|
||||||
- Fix the use of regular expressions to avoid crashes with Qt4.5.
|
- Fix the use of regular expressions to avoid crashes with Qt4.5.
|
||||||
|
|
||||||
|
- Fix an infinite loop when creating multiple unnamed files with Qt4.5.
|
||||||
|
|
||||||
- Ignore the master_buffer setting in Document>Settings if the current
|
- Ignore the master_buffer setting in Document>Settings if the current
|
||||||
document is no real child. This fixes a crash when using the outliner
|
document is no real child. This fixes a crash when using the outliner
|
||||||
in such files (bug 5653).
|
in such files (bug 5653).
|
||||||
|
Loading…
Reference in New Issue
Block a user