Revert "fix(editor): persist file encoding across sessions" (bug-fix-365847) - #492
Conversation
This reverts commit 1d54985. 需求调整,回退 PR linuxdeepin#491(bug-fix-365847)的编码历史持久化改动, 代码恢复到该 PR 合并前的状态。 Log: 回退编码历史持久化机制改动 Bug: https://pms.uniontech.com/bug-view-365847.html
There was a problem hiding this comment.
Sorry @GongHeng2017, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR cleanly reverts a previous change that persisted file encoding history and preferred encodings across sessions, restoring the editor’s behavior to rely solely on automatic detection and removing all call sites and data members related to the reverted feature. Sequence diagram for file open without encoding history persistencesequenceDiagram
actor User
participant Window
participant EditWrapper
participant TextEdit
participant FileLoadThread
participant DetectCode
User->>Window: saveAsFileToDisk
Window->>EditWrapper: openFile(filepath, qstrTruePath, bKeep)
EditWrapper->>TextEdit: setFilePath(filepath)
EditWrapper->>FileLoadThread: FileLoadThread(filepath)
EditWrapper->>FileLoadThread: run
FileLoadThread->>FileLoadThread: QFile.open
FileLoadThread->>FileLoadThread: read(indata)
FileLoadThread->>DetectCode: GetFileEncodingFormat(m_strFilePath, indata)
DetectCode-->>FileLoadThread: encode
FileLoadThread-->>EditWrapper: sigPreProcess(encode, content)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 本次变更无需修复,代码已处于良好状态。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017, max-lvs 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 |
|
/merge |
回退 PR #491(bug-fix-365847)
背景
PR #491(commit
1d549851,"fix(editor): persist file encoding across sessions")已合并入release/eagle,用于修复 BUG-365847(切换编码保存后重新打开编码丢失)。由于当前需求调整,需要回退该提交。
回退内容
使用
git revert 1d549851精确反向应用 PR #491 的全部变更,将代码恢复到该 PR 合并前(9735678e)的状态:src/common/fileloadthread.hsetPreferredEncode()方法和m_preferredEncode成员变量src/common/fileloadthread.cppsetPreferredEncode()实现;run()恢复为完全依赖自动探测src/editor/dtextedit.hsetTextEncode()setter 和readEncodeHistoryRecord(filepath)重载声明src/editor/dtextedit.cppreadEncodeHistoryRecord(filepath)重载实现src/editor/editwrapper.cppopenFile/saveFile/forceSaveInvalidCharFile/saveDraftFile中编码历史相关调用src/widgets/window.cppsaveAsFileToDisk中编码历史记录调用变更规模:6 个文件,+1 行 / -79 行(与 PR #491 的 +79/-1 互为逆操作)。已逐文件校验,回退后内容与合并前提交
9735678e完全一致。验证
git revert无冲突(PR fix(editor): persist file encoding across sessions #491 为release/eagle的 HEAD,其上无后续提交依赖)9735678e对应文件完全一致(逐文件 diff 校验通过)writeEncodeHistoryRecord()/readEncodeHistoryRecord()原始实现(恢复为"死代码"状态)关联
Log: 回退编码历史持久化机制改动
Bug: https://pms.uniontech.com/bug-view-365847.html
Summary by Sourcery
Revert the previously introduced file encoding persistence behavior and restore the editor’s prior encoding handling.
Enhancements:
Chores: