X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FFileName.cpp;h=929c4165bebd541bead6ce6e7a6a61774e12f89d;hb=8d640dc77608bedddb5b00982c23665584f52d21;hp=05ada4c596d15641e7a78bd2e1b33950d837493d;hpb=07079e7da37044cc97da9c4d129a3e48a7b49d95;p=lyx.git diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 05ada4c596..929c4165be 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -18,7 +18,6 @@ #include "support/lassert.h" #include "support/lstrings.h" #include "support/mutex.h" -#include "support/qstring_helpers.h" #include "support/os.h" #include "support/Package.h" #include "support/qstring_helpers.h" @@ -32,7 +31,6 @@ #include #include -#include #include #include @@ -320,6 +318,9 @@ bool FileName::isSymLink() const } +//QFileInfo caching info might fool this test if file was changed meanwhile. +//refresh() helps, but we don't want to put it blindly here, because it might +//trigger slowdown on networked file systems. bool FileName::isFileEmpty() const { LASSERT(!empty(), return true); @@ -491,6 +492,12 @@ bool FileName::chdir() const } +bool FileName::link(FileName const & name) const +{ + return QFile::link(toqstr(absFileName()), toqstr(name.absFileName())); +} + + unsigned long checksum_ifstream_fallback(char const * file) { unsigned long result = 0;