-
Notifications
You must be signed in to change notification settings - Fork 181
Revert "fix: Copying files from cloud desktop cannot be copied to the… #2916
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
… local machine" This reverts commit da1dd4f.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs 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 |
deepin pr auto review代码审查意见:
以上是代码审查意见,请根据实际情况进行修改和调整。 |
Reviewer's GuideThis PR reverts the cloud desktop file copy feature by stripping out X11 clipboard monitoring and related dependencies, refactors clipboard change handling to directly use QClipboard::mimeData, updates plugin initialization to remove first-read logic, and cleans up CMake configurations by dropping XCB checks and linking. Sequence Diagram: Clipboard Data Processing FlowsequenceDiagram
title "Sequence Diagram: Clipboard Data Processing Flow"
participant QAppClipboard as "QApplication::clipboard()"
participant ClipBoardService as "dfmbase::ClipBoard"
participant QClipboardAPI as "QClipboard API"
participant GlobalHandler as "GlobalData::onClipboardDataChanged"
QAppClipboard ->> ClipBoardService: dataChanged() signal
activate ClipBoardService
ClipBoardService ->> ClipBoardService: onClipboardDataChanged() slot
ClipBoardService ->> QClipboardAPI: mimeData()
QClipboardAPI -->> ClipBoardService: const QMimeData*
ClipBoardService ->> GlobalHandler: onClipboardDataChanged()
ClipBoardService ->> ClipBoardService: emit clipboardDataChanged() signal
deactivate ClipBoardService
Sequence Diagram: Plugin Clipboard Initialization Method ChangesequenceDiagram
title "Sequence Diagram: Plugin Clipboard Initialization Method Change"
participant CorePlugin as "Core Plugin (ddplugin-core/dfmplugin-core)"
participant ClipBoardService as "dfmbase::ClipBoard"
CorePlugin ->> ClipBoardService: instance()
ClipBoardService -->> CorePlugin: ClipBoard*
alt Removed Initialization Path
CorePlugin ->> ClipBoardService: readFirstClipboard() (Method Removed)
activate ClipBoardService
%% Internally would have called onClipboardDataChanged(formats)
deactivate ClipBoardService
else Current Initialization Path
CorePlugin ->> ClipBoardService: onClipboardDataChanged()
activate ClipBoardService
%% Internally processes clipboard data directly
deactivate ClipBoardService
end
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 @Johnson-zs - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/dfm-base/utils/clipboard.cpp:59` </location>
<code_context>
+ if (mimeData->hasFormat(kRemoteCopyKey)) {
+ qCWarning(logDFMBase) << "clipboard use other !";
clipboardAction = ClipBoard::kRemoteAction;
remoteCurrentCount++;
return;
}
</code_context>
<issue_to_address>
Incrementing QAtomicInt with ++ may not convey memory ordering
Prefer using an explicit atomic method such as `fetchAndAddRelaxed(1)` to make memory ordering intentions clear.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
remoteCurrentCount++;
=======
remoteCurrentCount.fetchAndAddRelaxed(1);
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| // 远程协助功能 | ||
| if (formats.contains(kRemoteAssistanceCopyKey)) { | ||
| qCInfo(logDFMBase) << "Remote assistance copy action detected"; | ||
| if (mimeData->hasFormat(kRemoteAssistanceCopyKey)) { |
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.
suggestion: Incrementing QAtomicInt with ++ may not convey memory ordering
Prefer using an explicit atomic method such as fetchAndAddRelaxed(1) to make memory ordering intentions clear.
| remoteCurrentCount++; | |
| remoteCurrentCount.fetchAndAddRelaxed(1); |
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.
revert不对原逻辑改动
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.
这条建议只是从“风格和可读性”角度来提:
QAtomicInt 的 “++” 操作确实会原子加一,但它的内存顺序语义是隐含的。为了让代码读起来更直观,也更明确地表达“这里不需要强制的 acquire/release,仅仅是一个放宽版的原子加一”,我们才推荐把
remoteCurrentCount++;改成
remoteCurrentCount.fetchAndAddRelaxed(1);两者在功能上是一致的,不会改变现有逻辑。如果你觉得“++”已经足够且更简洁,也完全可以保留,PR 的 revert 本身也不影响这部分行为。只是为了后续维护时一看就知道“这是个 relax(宽松)模式的原子加一”,才建议显式调用 fetchAndAddRelaxed。
|
Note
详情{
"src/plugins/common/dfmplugin-fileoperations/fileoperationsevent/fileoperationseventreceiver.cpp": [
{
"line": " key = \"Name\";",
"line_number": 375,
"rule": "S106",
"reason": "Var naming | ff5dbee3ee"
}
]
} |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
… local machine"
This reverts commit da1dd4f.
Summary by Sourcery
Revert the previous remote-copy fix and remove all X11 clipboard monitoring support in favor of a simplified Qt-only implementation.
Enhancements:
Build: