mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
New discovery algorithm: Fix directory deletion
TestAllFilesDeleted passes
This commit is contained in:
parent
d54e00488a
commit
22d989e272
2 changed files with 7 additions and 10 deletions
|
@ -85,6 +85,8 @@ public:
|
|||
void start();
|
||||
void abort();
|
||||
|
||||
SyncFileItemPtr _dirItem;
|
||||
|
||||
private:
|
||||
struct PathTuple
|
||||
{
|
||||
|
@ -121,7 +123,6 @@ private:
|
|||
QPointer<DiscoverServerJob> _serverJob;
|
||||
std::deque<ProcessDirectoryJob *> _queuedJobs;
|
||||
QVector<ProcessDirectoryJob *> _runningJobs;
|
||||
SyncFileItemPtr _dirItem;
|
||||
QueryMode _queryServer;
|
||||
QueryMode _queryLocal;
|
||||
DiscoveryPhase *_discoveryData;
|
||||
|
|
|
@ -925,7 +925,9 @@ void SyncEngine::slotStartDiscovery()
|
|||
_discoveryPhase.data(), this);
|
||||
// FIXME! this sucks
|
||||
auto runQueuedJob = [this](ProcessDirectoryJob *job, const auto &runQueuedJob) -> void {
|
||||
connect(job, &ProcessDirectoryJob::finished, this, [this, runQueuedJob] {
|
||||
connect(job, &ProcessDirectoryJob::finished, this, [this, job, runQueuedJob] {
|
||||
if (job->_dirItem)
|
||||
job->itemDiscovered(job->_dirItem);
|
||||
sender()->deleteLater();
|
||||
if (!_discoveryPhase->_queuedDeletedDirectories.isEmpty()) {
|
||||
auto job = qobject_cast<ProcessDirectoryJob *>(_discoveryPhase->_queuedDeletedDirectories.take(_discoveryPhase->_queuedDeletedDirectories.firstKey()).data());
|
||||
|
@ -1012,18 +1014,11 @@ void SyncEngine::slotDiscoveryJobFinished()
|
|||
|
||||
// qCInfo(lcEngine) << "Permissions of the root folder: " << _csync_ctx->remote.root_perms.toString();
|
||||
|
||||
/*
|
||||
|
||||
// Adjust the paths for the renames.
|
||||
for (const auto &syncItem : qAsConst(syncItems)) {
|
||||
syncItem->_file = adjustRenamedPath(syncItem->_file);
|
||||
}
|
||||
|
||||
ConfigFile cfgFile;
|
||||
if (!_hasNoneFiles && _hasRemoveFile && cfgFile.promptDeleteFiles()) {
|
||||
qCInfo(lcEngine) << "All the files are going to be changed, asking the user";
|
||||
bool cancel = false;
|
||||
emit aboutToRemoveAllFiles(syncItems.first()->_direction, &cancel);
|
||||
emit aboutToRemoveAllFiles(_syncItems.first()->_direction, &cancel);
|
||||
if (cancel) {
|
||||
qCInfo(lcEngine) << "User aborted sync";
|
||||
finalize(false);
|
||||
|
@ -1031,6 +1026,7 @@ void SyncEngine::slotDiscoveryJobFinished()
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
auto databaseFingerprint = _journal->dataFingerprint();
|
||||
// If databaseFingerprint is empty, this means that there was no information in the database
|
||||
// (for example, upgrading from a previous version, or first sync, or server not supporting fingerprint)
|
||||
|
|
Loading…
Reference in a new issue