Bugfixes and tidying.

This commit is contained in:
David Given
2022-09-07 00:37:26 +02:00
parent 352abe07d8
commit 157a525ec1

View File

@@ -646,6 +646,8 @@ public:
[this, path, localPath, item]() mutable [this, path, localPath, item]() mutable
{ {
path = ResolveFileConflicts_WT(path); path = ResolveFileConflicts_WT(path);
if (path.empty())
return;
auto bytes = Bytes::readFromFile(localPath); auto bytes = Bytes::readFromFile(localPath);
_filesystem->putFile(path, bytes); _filesystem->putFile(path, bytes);
@@ -715,18 +717,21 @@ public:
QueueBrowserOperation( QueueBrowserOperation(
[this, node]() mutable [this, node]() mutable
{ {
auto oldpath = node->dirent->path; auto oldPath = node->dirent->path;
auto newpath = oldpath.parent(); auto newPath = oldPath.parent();
newpath.push_back(node->newname); newPath.push_back(node->newname);
newpath = ResolveFileConflicts_WT(newpath); newPath = ResolveFileConflicts_WT(newPath);
_filesystem->moveFile(oldpath, newpath); if (newPath.empty())
return;
auto dirent = _filesystem->getDirent(newpath); _filesystem->moveFile(oldPath, newPath);
auto dirent = _filesystem->getDirent(newPath);
runOnUiThread( runOnUiThread(
[&]() [&]()
{ {
_filesystemModel->Delete(oldpath); _filesystemModel->Delete(oldPath);
_filesystemModel->Add(dirent); _filesystemModel->Add(dirent);
}); });
}); });
@@ -749,6 +754,9 @@ public:
[this, oldPath, newPath]() mutable [this, oldPath, newPath]() mutable
{ {
newPath = ResolveFileConflicts_WT(newPath); newPath = ResolveFileConflicts_WT(newPath);
if (newPath.empty())
return;
_filesystem->moveFile(oldPath, newPath); _filesystem->moveFile(oldPath, newPath);
auto dirent = _filesystem->getDirent(newPath); auto dirent = _filesystem->getDirent(newPath);