]> git.lyx.org Git - lyx.git/commitdiff
Fix bug 5075, I hope.
authorRichard Heck <rgheck@comcast.net>
Mon, 21 Jul 2008 16:39:46 +0000 (16:39 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 21 Jul 2008 16:39:46 +0000 (16:39 +0000)
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
src/support/FileName.cpp

index b46be350b850010964b3c6322381b7dd86cda0ba..c59b7ddc086101d048d20a9d0287ee576c77f75f 100644 (file)
@@ -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;
 
index a2140525893eb149614042e4101eaafe83a797a8..453966e156a10cbee0dd15d1299fd41b4d47e598 100644 (file)
@@ -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();
 }