Check for case clash on downloads.

This commit is contained in:
Klaas Freitag 2014-05-23 18:55:44 +02:00
parent 57359968ed
commit bbdf7bf955

View file

@ -22,6 +22,7 @@
#include "propagatorjobs.h"
#include <QNetworkAccessManager>
#include <QFileInfo>
#include <QDir>
#include <cmath>
namespace Mirall {
@ -430,8 +431,6 @@ void GETFileJob::slotReadyRead()
resetTimeout();
}
void PropagateDownloadFileQNAM::start()
{
if (_propagator->_abortRequested.fetchAndAddRelaxed(0))
@ -439,6 +438,13 @@ void PropagateDownloadFileQNAM::start()
qDebug() << Q_FUNC_INFO << _item._file << _propagator->_activeJobs;
// do a case clash check.
if( Utility::fsCasePreserving() && _propagator->localFileNameClash(_item._file) ) {
done( SyncFileItem::NormalError, tr("File %1 can not be downloaded because of a local file name clash!")
.arg(QDir::toNativeSeparators(_item._file)) );
return;
}
emit progress(_item, 0);
QString tmpFileName;