mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +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;
|
||||
}
|
||||
|
||||
void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
|
||||
void OwncloudPropagator::start(const SyncFileItemVector& items)
|
||||
{
|
||||
/* This builds all the job needed for the propagation.
|
||||
* 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
|
||||
* directory, we can create the directory job and push it on the stack. */
|
||||
SyncFileItemVector items = _syncedItems;
|
||||
std::sort(items.begin(), items.end());
|
||||
* In order to do that we loop over the items. (which are sorted by destination)
|
||||
* When we enter adirectory, we can create the directory job and push it on the stack. */
|
||||
|
||||
_rootJob.reset(new PropagateDirectory(this));
|
||||
QStack<QPair<QString /* directory name */, PropagateDirectory* /* job */> > directories;
|
||||
directories.push(qMakePair(QString(), _rootJob.data()));
|
||||
|
|
|
@ -557,6 +557,9 @@ void SyncEngine::slotUpdateFinished(int updateResult)
|
|||
it->_file = adjustRenamedPath(it->_file);
|
||||
}
|
||||
|
||||
// Sort items per destination
|
||||
std::sort(_syncedItems.begin(), _syncedItems.end());
|
||||
|
||||
// make sure everything is allowed
|
||||
checkForPermission();
|
||||
|
||||
|
|
Loading…
Reference in a new issue