Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure syncStateChanged is emitted #10642

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Ensure syncStateChanged is emitted #10642

merged 1 commit into from
Mar 30, 2023

Conversation

TheOneRing
Copy link
Contributor

No description provided.

@TheOneRing TheOneRing requested a review from a team March 29, 2023 10:01
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -454,19 +453,21 @@ void Folder::setSyncPaused(bool paused)
_definition.paused = paused;
saveToSettings();

emit syncPausedChanged(this, paused);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would one send this as payload? Isn't that what sender() is there for?

Otherwise, I wonder why this is needed at all. setSyncState(SyncResult::Paused) should do, right? Seems redundant to me.

Copy link
Contributor Author

@TheOneRing TheOneRing Mar 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved the code, feel free to open another refactoring issue.

if (!paused) {
setSyncState(SyncResult::NotYetStarted);
} else {
setSyncState(SyncResult::Paused);
}
emit syncPausedChanged(this, paused);
emit syncStateChange();
emit canSyncChanged();
}

void Folder::setSyncState(SyncResult::Status state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this could be renamed to changeSyncState to suggest that this emits a signal, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not how Qt api is named

@TheOneRing TheOneRing requested a review from fmoc March 29, 2023 11:27
@TheOneRing TheOneRing merged commit 3ed0150 into master Mar 30, 2023
@delete-merged-branch delete-merged-branch bot deleted the work/9270_2 branch March 30, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants