Fix e2ee folder move issue

Signed-off-by: allexzander <blackslayer4@gmail.com>
This commit is contained in:
allexzander 2021-01-12 17:51:32 +02:00
parent c34c0f078b
commit 96472320e4
2 changed files with 17 additions and 0 deletions

View file

@ -887,6 +887,11 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
qCInfo(lcDisco) << "Not a move, no item in db with inode" << localEntry.inode;
return false;
}
if (base._isE2eEncrypted || isInsideEncryptedTree()) {
return false;
}
if (base.isDirectory() != item->isDirectory()) {
qCInfo(lcDisco) << "Not a move, types don't match" << base._type << item->_type << localEntry.type;
return false;
@ -1149,6 +1154,7 @@ void ProcessDirectoryJob::processFileFinalize(
}
if (recurse) {
auto job = new ProcessDirectoryJob(path, item, recurseQueryLocal, recurseQueryServer, this);
job->setInsideEncryptedTree(isInsideEncryptedTree() || item->_isEncrypted);
if (removed) {
job->setParent(_discoveryData);
_discoveryData->_queuedDeletedDirectories[path._original] = job;

View file

@ -88,6 +88,16 @@ public:
/** Start up to nbJobs, return the number of job started; emit finished() when done */
int processSubJobs(int nbJobs);
void setInsideEncryptedTree(bool isInsideEncryptedTree)
{
_isInsideEncryptedTree = isInsideEncryptedTree;
}
bool isInsideEncryptedTree() const
{
return _isInsideEncryptedTree;
}
SyncFileItemPtr _dirItem;
private:
@ -273,6 +283,7 @@ private:
bool _childModified = false; // the directory contains modified item what would prevent deletion
bool _childIgnored = false; // The directory contains ignored item that would prevent deletion
PinState _pinState = PinState::Unspecified; // The directory's pin-state, see computePinState()
bool _isInsideEncryptedTree = false; // this directory is encrypted or is within the tree of directories with root directory encrypted
signals:
void finished();