mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Permissions: fix restoring subdirectories
The sync item vector must be sorted before we call checkForPermission
This commit is contained in:
parent
9066ad5790
commit
09881040a3
2 changed files with 7 additions and 5 deletions
|
@ -216,14 +216,13 @@ PropagateItemJob* OwncloudPropagator::createJob(const SyncFileItem& item) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
|
void OwncloudPropagator::start(const SyncFileItemVector& items)
|
||||||
{
|
{
|
||||||
/* This builds all the job needed for the propagation.
|
/* This builds all the job needed for the propagation.
|
||||||
* Each directories is a PropagateDirectory job, which contains the files in it.
|
* Each directories is a PropagateDirectory job, which contains the files in it.
|
||||||
* In order to do that we sort the items by destination. and loop over it. When we enter a
|
* In order to do that we loop over the items. (which are sorted by destination)
|
||||||
* directory, we can create the directory job and push it on the stack. */
|
* When we enter adirectory, we can create the directory job and push it on the stack. */
|
||||||
SyncFileItemVector items = _syncedItems;
|
|
||||||
std::sort(items.begin(), items.end());
|
|
||||||
_rootJob.reset(new PropagateDirectory(this));
|
_rootJob.reset(new PropagateDirectory(this));
|
||||||
QStack<QPair<QString /* directory name */, PropagateDirectory* /* job */> > directories;
|
QStack<QPair<QString /* directory name */, PropagateDirectory* /* job */> > directories;
|
||||||
directories.push(qMakePair(QString(), _rootJob.data()));
|
directories.push(qMakePair(QString(), _rootJob.data()));
|
||||||
|
|
|
@ -557,6 +557,9 @@ void SyncEngine::slotUpdateFinished(int updateResult)
|
||||||
it->_file = adjustRenamedPath(it->_file);
|
it->_file = adjustRenamedPath(it->_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort items per destination
|
||||||
|
std::sort(_syncedItems.begin(), _syncedItems.end());
|
||||||
|
|
||||||
// make sure everything is allowed
|
// make sure everything is allowed
|
||||||
checkForPermission();
|
checkForPermission();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue