-
Notifications
You must be signed in to change notification settings - Fork 37
fix: set "compress_to_zip" compress level to 0 #362
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: as title
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSets the compression level to 0 when starting the app in 'compress to zip/7z' mode to align with the intended behavior for the ST_Compresstozip7z startup type. 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 - I've left some high level feedback:
- Consider replacing the magic numeric compression levels (0/1) with named constants or an enum to make the intent of the chosen level clearer and easier to maintain.
- If there is a single place where default compression behavior is defined, it may be cleaner to derive
stOptions.iCompressionLevelfrom that shared configuration rather than hardcoding it in this code path.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider replacing the magic numeric compression levels (0/1) with named constants or an enum to make the intent of the chosen level clearer and easier to maintain.
- If there is a single place where default compression behavior is defined, it may be cleaner to derive `stOptions.iCompressionLevel` from that shared configuration rather than hardcoding it in this code path.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review针对这段 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与改进建议这段代码修改将特定启动模式下的默认压缩级别从 主要建议:
代码重构示例: // 建议在类或全局头文件中定义
const int COMPRESSION_LEVEL_STORE = 0;
const int COMPRESSION_LEVEL_FASTEST = 1;
void MainWindow::slotFinishCalculateSize(...)
{
if (StartupType::ST_Compresstozip7z == m_eStartupType) {
// 明确指定为存储模式(不压缩),如果确实需要此逻辑
stOptions.iCompressionLevel = COMPRESSION_LEVEL_STORE;
#ifdef DTKCORE_CLASS_DConfigFile
// 注意检查这里的逻辑是否会受到上面赋值的影响
if(m_pCompressSettingPage->isOrderMode()) {
// ...结论:从语法上没有错误,但从逻辑上看,将压缩级别设为 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, 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 |
Log: as title
Summary by Sourcery
Bug Fixes: