Skip to content

Commit

Permalink
fix more review comments by sonarcloud
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Oct 31, 2022
1 parent 54154a7 commit 518be9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/libsync/owncloudpropagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void OwncloudPropagator::start(SyncFileItemVector &&items)
}

foreach (PropagatorJob *it, directoriesToRemove) {
_rootJob->_dirDeletionJobs.appendJob(it);
_rootJob->appendDirDeletionJob(it);
}

connect(_rootJob.data(), &PropagatorJob::finished, this, &OwncloudPropagator::emitFinished);
Expand Down Expand Up @@ -1292,6 +1292,11 @@ qint64 PropagateRootDirectory::committedDiskSpace() const
return _subJobs.committedDiskSpace() + _dirDeletionJobs.committedDiskSpace();
}

void PropagateRootDirectory::appendDirDeletionJob(PropagatorJob *job)
{
_dirDeletionJobs.appendJob(job);
}

bool PropagateRootDirectory::scheduleSelfOrChild()
{
qCInfo(lcRootDirectory()) << "scheduleSelfOrChild" << _state << "pending uploads" << propagator()->delayedTasks().size() << "subjobs state" << _subJobs._state;
Expand Down
7 changes: 5 additions & 2 deletions src/libsync/owncloudpropagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ class OWNCLOUDSYNC_EXPORT PropagateRootDirectory : public PropagateDirectory
{
Q_OBJECT
public:
PropagatorCompositeJob _dirDeletionJobs;

explicit PropagateRootDirectory(OwncloudPropagator *propagator);

bool scheduleSelfOrChild() override;
Expand All @@ -375,6 +373,9 @@ class OWNCLOUDSYNC_EXPORT PropagateRootDirectory : public PropagateDirectory

[[nodiscard]] qint64 committedDiskSpace() const override;

public slots:
void appendDirDeletionJob(PropagatorJob *job);

private slots:
void slotSubJobsFinished(SyncFileItem::Status status) override;
void slotDirDeletionJobsFinished(SyncFileItem::Status status);
Expand All @@ -383,6 +384,8 @@ private slots:

bool scheduleDelayedJobs();

PropagatorCompositeJob _dirDeletionJobs;

SyncFileItem::Status _errorStatus = SyncFileItem::Status::NoStatus;
};

Expand Down

0 comments on commit 518be9d

Please sign in to comment.