-
Notifications
You must be signed in to change notification settings - Fork 61
fix: Invalid expressions will be stored as exceptions #181
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
log: Invalid expression input causes abnormal memory display. bug: https://pms.uniontech.com/bug-view-337825.html
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR refines the MS memory-store logic in BasicModule by introducing a guard that ensures only valid, calculable expressions are stored, accompanied by a clarifying comment. Sequence diagram for MS memory-store logic updatesequenceDiagram
participant User as actor User
participant BasicModule
participant ExpressionBar
participant InputEdit
participant MemoryPublic
User->>BasicModule: Press MS key
BasicModule->>ExpressionBar: settingLinkage()
BasicModule->>InputEdit: getMemoryAnswer()
InputEdit-->>BasicModule: (isCalculable, result)
alt Expression is calculable
BasicModule->>MemoryPublic: generateData(result)
else Expression is not calculable
BasicModule-->>BasicModule: Do not store to memory
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来对这个代码变更进行审查:
// 仅当输入栏存在可计算结果时才执行MS存储
// 避免将无效表达式(如未完结的"89×")错误存为0
bool hasValidResult = m_expressionBar->getInputEdit()->getMemoryAnswer().first;
if (hasValidResult) {
qInfo() << "Generating memory data from keypad";
m_memoryPublic->generateData(m_expressionBar->getInputEdit()->getMemoryAnswer().second);
}总体来说,这是一个良好的代码改进,提高了代码的可读性和安全性。建议在后续开发中继续保持这种良好的注释习惯。 |
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.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL, 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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
log: Invalid expression input causes abnormal memory display.
bug: https://pms.uniontech.com/bug-view-337825.html
Summary by Sourcery
Bug Fixes: