]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileName.cpp
Revert unintentional commits.
[lyx.git] / src / support / FileName.cpp
index f9d27ca8bc22740ecf7445ee49d5b6d0cfbd7d1b..a2140525893eb149614042e4101eaafe83a797a8 100644 (file)
@@ -28,7 +28,7 @@
 #include <QList>
 #include <QTime>
 
-#include "support/assert.h"
+#include "support/lassert.h"
 #include <boost/scoped_array.hpp>
 
 #include <map>
@@ -166,11 +166,12 @@ void FileName::erase()
 
 bool FileName::copyTo(FileName const & name) const
 {
+       LYXERR(Debug::FILES, "Copying " << name);
        QFile::remove(name.d->fi.absoluteFilePath());
        bool success = QFile::copy(d->fi.absoluteFilePath(), name.d->fi.absoluteFilePath());
        if (!success)
-               lyxerr << "FileName::copyTo(): Could not copy file "
-                       << *this << " to " << name << endl;
+               LYXERR0("FileName::copyTo(): Could not copy file "
+                       << *this << " to " << name);
        return success;
 }
 
@@ -414,6 +415,10 @@ FileName FileName::getcwd()
 
 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();
        return d->fi.lastModified().toTime_t();
 }