-
Notifications
You must be signed in to change notification settings - Fork 30
fix(sessionmanager): adapt QString::arg usage for Qt 6.10 #174
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
Conversation
|
Hi @hillwoodroc. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdapts a QString::arg() call to be compatible with Qt 6.10 by extracting the numeric value from a QDBusReply before formatting the string, preserving existing behavior while fixing a template substitution failure. Sequence diagram for SessionManager::SetLocked QDBusReply value extractionsequenceDiagram
participant SessionManager
participant QDBusConnection
participant QDBusConnectionInterface
participant QDBusReply_unsigned_int as QDBusReply_unsigned_int
participant QString
SessionManager->>QDBusConnection: connection()
QDBusConnection-->>SessionManager: QDBusConnection
SessionManager->>QDBusConnection: interface()
QDBusConnection-->>SessionManager: QDBusConnectionInterface
SessionManager->>QDBusConnectionInterface: servicePid(message().service())
QDBusConnectionInterface-->>SessionManager: QDBusReply_unsigned_int
SessionManager->>QDBusReply_unsigned_int: value()
QDBusReply_unsigned_int-->>SessionManager: unsigned_int_pid
SessionManager->>QString: QString("/proc/%1/cmdline").arg(unsigned_int_pid)
QString-->>SessionManager: cmdLine (QString)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Consider checking the QDBusReply from servicePid() for validity (e.g., reply.isValid()) before calling .value(), so that you can handle or log error cases instead of silently using a default-constructed value when the DBus call fails.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider checking the QDBusReply from servicePid() for validity (e.g., reply.isValid()) before calling .value(), so that you can handle or log error cases instead of silently using a default-constructed value when the DBus call fails.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 2.0.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a compilation issue with Qt 6.10 where QDBusReply<T> can no longer be directly passed to QString::arg() due to template substitution failures. The fix extracts the actual value using .value() before passing it to the formatting function.
Key Changes:
- Modified
SetLocked()method to call.value()on theQDBusReply<unsigned int>returned byservicePid()before using it inQString::arg()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Qt 6.10.1 no longer accepts QDBusReply<T> as an argument to QString::arg(). Passing a QDBusReply<unsigned int> directly results in a template substitution failure with enable_if<false>. This fix extracts the actual value using .value() before passing it to QString::arg(), restoring compatibility with Qt 6.10.1 and preserving existing logic.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hillwoodroc, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Qt 6.10 no longer accepts QDBusReply as an argument to QString::arg(). Passing a QDBusReply directly results in a template substitution failure with enable_if.
This fix extracts the actual value using .value() before passing it to QString::arg(), restoring compatibility with Qt 6.10 and preserving existing logic.
Summary by Sourcery
Bug Fixes: