From e4c7a9a677f2efedd753a6d8b5c3c756ea7b3ab5 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 21 Jul 2008 16:39:46 +0000 Subject: [PATCH] Fix bug 5075, I hope. If Trolltech ever fixes this, then we can put an upper bound onto the #if. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25773 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 2 ++ src/support/FileName.cpp | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index b46be350b8..c59b7ddc08 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -938,10 +938,12 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd) break; case LFUN_LAYOUT: + LYXERR0("BufferView::getStatus(LFUN_LAYOUT)"); flag.setEnabled(!cur.inset().forcePlainLayout(cur.idx())); break; case LFUN_LAYOUT_PARAGRAPH: + LYXERR0("BufferView::getStatus(LFUN_LAYOUT_PARAGRAPH)"); flag.setEnabled(cur.inset().allowParagraphCustomization(cur.idx())); break; diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index a214052589..453966e156 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -94,6 +94,17 @@ struct FileName::Private fi.setCaching(fi.exists() ? true : false); } /// + inline void refresh() + { +// There seems to be a bug in Qt 4.3.5, at least, that causes problems with +// QFileInfo::refresh() on Linux. So we recreate the object in that case. +#if defined(__linux__) && (QT_VERSION >= 0x040300) + fi = QFileInfo(fi.absoluteFilePath()); +#else + fi.refresh(); +#endif + } + /// QFileInfo fi; }; @@ -418,7 +429,7 @@ time_t FileName::lastModified() const // QFileInfo caches information about the file. So, in case this file has // been touched between the object creation and now, we refresh the file // information. - d->fi.refresh(); + d->refresh(); return d->fi.lastModified().toTime_t(); }