fix: Update file path handling in saveAsFileToDisk function#374
Merged
lzwind merged 2 commits intolinuxdeepin:masterfrom Jul 18, 2025
Merged
fix: Update file path handling in saveAsFileToDisk function#374lzwind merged 2 commits intolinuxdeepin:masterfrom
lzwind merged 2 commits intolinuxdeepin:masterfrom
Conversation
- Save the original file path before updating to prevent premature checks on file existence. - Update the file path only after a successful save to ensure accuracy. log: Update file path handling in saveAsFileToDisk function bug: https://pms.uniontech.com/bug-view-322759.html
- Updated version to 6.5.32 in all architecture-specific linglong.yaml files. - Changed package source URLs from testing25_daily to crimson_25.0 for consistency across architectures. log: Update version and package URLs in linglong.yaml files
|
TAG Bot TAG: 6.5.32 |
Reviewer's GuideThis PR refactors the saveAsFileToDisk logic to cache the original file path and defer path updates until after a successful save, and bumps the package version and source URLs in the build metadata. Sequence diagram for updated saveAsFileToDisk file path handlingsequenceDiagram
participant User
participant Window
participant Wrapper
participant Settings
participant FileSystem
User->>Window: Trigger saveAsFileToDisk()
Window->>Wrapper: filePath()
Window->>Settings: setSavePath(LastOptBox, newFilePath)
Window->>Settings: setSavePath(CurFileBox, newFilePath)
Window->>Wrapper: filePath() (store as oldFilePath)
Window->>FileSystem: Check if file exists
alt File exists
Window->>Wrapper: saveFile(newFilePath, encode)
else File does not exist
Window->>Wrapper: saveFile(newFilePath, encode)
end
alt Save successful
Window->>Wrapper: updatePath(oldFilePath, newFilePath)
Window->>Wrapper: bottomBar().setEncodeName(encode)
Window->>Window: updateSaveAsFileName(oldFilePath, newFilePath)
Window-->>User: Return newFilePath
else Save failed
Window-->>User: Return empty string
end
Class diagram for updated saveAsFileToDisk logicclassDiagram
class Window {
+QString saveAsFileToDisk()
-void updateSaveAsFileName(QString oldFilePath, QString newFilePath)
}
class Wrapper {
+QString filePath()
+void updatePath(QString oldFilePath, QString newFilePath)
+QByteArray getTextEncode()
+BottomBar* bottomBar()
+bool saveFile(QString filePath, QByteArray encode)
}
class Settings {
+void setSavePath(int boxType, QString path)
}
class BottomBar {
+void setEncodeName(QByteArray encode)
}
Window --> Wrapper
Window --> Settings
Wrapper --> BottomBar
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review |
There was a problem hiding this comment.
Hey @dengzhongyuan365-dev - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
lzwind
approved these changes
Jul 18, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind 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 |
|
Note
详情{
"src/widgets/window.cpp": [
{
"line": " QString key = \"base/enable\";",
"line_number": 387,
"rule": "S106",
"reason": "Var naming | 64f28539d9"
}
]
} |
This was referenced Jul 18, 2025
Open
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.
fix: Update file path handling in saveAsFileToDisk function
log: Update file path handling in saveAsFileToDisk function
bug: https://pms.uniontech.com/bug-view-322759.html
Summary by Sourcery
Correct saveAsFileToDisk logic to hold the original file path during saving and only update it after a successful write; adjust related path‐update call to use the preserved old path.
Bug Fixes:
Enhancements: