#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"
#include <QTime>
#include <boost/crc.hpp>
-#include <boost/scoped_array.hpp>
#include <algorithm>
#include <iterator>
bool FileName::renameTo(FileName const & name) const
{
- LYXERR(Debug::FILES, "Renaming " << name);
+ LYXERR(Debug::FILES, "Renaming " << name << " as " << *this);
bool success = QFile::rename(d->fi.absoluteFilePath(), name.d->fi.absoluteFilePath());
if (!success)
LYXERR0("Could not rename file " << *this << " to " << name);
bool FileName::moveTo(FileName const & name) const
{
- LYXERR(Debug::FILES, "Moving " << name);
+ LYXERR(Debug::FILES, "Moving " << name << " to " << *this);
QFile::remove(name.d->fi.absoluteFilePath());
bool success = QFile::rename(d->fi.absoluteFilePath(),
}
+//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);
}
+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;