Skip to content

Commit

Permalink
Merge branch 'fix/SNC-3378_removed_folder_node_in_local_size_controll…
Browse files Browse the repository at this point in the history
…er' into 'release/v4.9.3'

SNC-3378. Removing a folder node before chosing the download path causes a download block

See merge request desktop/desktop!1893
  • Loading branch information
mfm-mega committed Apr 20, 2023
2 parents ad6c2a8 + 1f3b9c4 commit ba6d82e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/MEGASync/control/DownloadQueueController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ void DownloadQueueController::startAvailableSpaceChecking()
}
else
{
if(!node->isForeign())
{
mFolderCountPendingSizeComputation++;
mMegaApi->getFolderInfo(node, mListener.get());
}
mFolderCountPendingSizeComputation++;
mMegaApi->getFolderInfo(node, mListener.get());
}

return partialSum;
Expand Down Expand Up @@ -86,11 +83,14 @@ WrappedNode *DownloadQueueController::dequeueDownloadQueue()

void DownloadQueueController::onRequestFinish(MegaApi*, MegaRequest *request, MegaError *e)
{
if (request->getType() == mega::MegaRequest::TYPE_FOLDER_INFO
&& e->getErrorCode() == mega::MegaError::API_OK)
if (request->getType() == mega::MegaRequest::TYPE_FOLDER_INFO)
{
auto folderInfo = request->getMegaFolderInfo();
mTotalQueueDiskSize += folderInfo->getCurrentSize();
if(e->getErrorCode() == mega::MegaError::API_OK)
{
auto folderInfo = request->getMegaFolderInfo();
mTotalQueueDiskSize += folderInfo->getCurrentSize();
}

--mFolderCountPendingSizeComputation;
if (mFolderCountPendingSizeComputation <= 0)
{
Expand Down

0 comments on commit ba6d82e

Please sign in to comment.