mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 14:05:58 +03:00
Case clash check for local remove plus native separators.
This commit is contained in:
parent
f1b2417967
commit
6017eb7ca6
1 changed files with 9 additions and 2 deletions
|
@ -76,9 +76,16 @@ void PropagateLocalRemove::start()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString filename = _propagator->_localDir + _item._file;
|
QString filename = _propagator->_localDir + _item._file;
|
||||||
|
if( _propagator->localFileNameClash(_item._file)) {
|
||||||
|
done(SyncFileItem::NormalError, tr("Could not remove %1 because of a local file name clash")
|
||||||
|
.arg(QDir::toNativeSeparators(filename)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_item._isDirectory) {
|
if (_item._isDirectory) {
|
||||||
if (QDir(filename).exists() && !removeRecursively(filename)) {
|
if (QDir(filename).exists() && !removeRecursively(filename)) {
|
||||||
done(SyncFileItem::NormalError, tr("Could not remove directory %1").arg(filename));
|
done(SyncFileItem::NormalError, tr("Could not remove directory %1")
|
||||||
|
.arg(QDir::toNativeSeparators(filename)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -187,7 +194,7 @@ void PropagateLocalRename::start()
|
||||||
// Fixme: the file that is the reason for the clash could be named here,
|
// Fixme: the file that is the reason for the clash could be named here,
|
||||||
// it would have to come out the localFileNameClash function
|
// it would have to come out the localFileNameClash function
|
||||||
done(SyncFileItem::NormalError, tr( "File %1 can not be renamed to %2 because of a local file name clash")
|
done(SyncFileItem::NormalError, tr( "File %1 can not be renamed to %2 because of a local file name clash")
|
||||||
.arg(_item._file).arg(_item._renameTarget) );
|
.arg(QDir::toNativeSeparators(_item._file)).arg(QDir::toNativeSeparators(_item._renameTarget)) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!file.rename(_propagator->_localDir + _item._file, _propagator->_localDir + _item._renameTarget)) {
|
if (!file.rename(_propagator->_localDir + _item._file, _propagator->_localDir + _item._renameTarget)) {
|
||||||
|
|
Loading…
Reference in a new issue