Fix check for OAuth::PromptValuesSupported - #1091
Open
TheOneRing wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Utility::enumValues() uses std::views but utility.h does not include <ranges>, which is likely to cause compilation failures in translation units that include this header.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates OAuth prompt-value handling to correctly treat OAuth::PromptValuesSupported as a Qt flags enum, and introduces a shared Utility::enumValues() helper (with a unit test) to iterate enum/flag values via Qt meta-object data.
Changes:
- Register
OAuth::PromptValuesSupportedas a flags enum (Q_FLAG) and use meta-enum iteration to stringify supported prompt flags. - Add
Utility::enumValues()for iteratingQMetaEnumvalues, with a new unit test exercising a namespace-scoped flags enum. - Extend test utilities with a
Q_NAMESPACE+Q_FLAG_NSenum for validating enum-utility behavior.
File summaries
| File | Description |
|---|---|
| test/testutils/testutils.h | Adds a namespace-scoped flags enum for testing enum meta-utilities. |
| test/testutility.cpp | Adds a unit test for Utility::enumValues(). |
| src/libsync/creds/oauth.h | Switches PromptValuesSupported registration from Q_ENUM to Q_FLAG. |
| src/libsync/creds/oauth.cpp | Uses Utility::enumValues() to stringify all supported prompt flags. |
| src/libsync/common/utility.h | Introduces Utility::enumValues() based on QMetaEnum. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TheOneRing
force-pushed
the
work/enum2
branch
from
September 8, 2026 10:49
5c59e2b to
16285e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.