-
Notifications
You must be signed in to change notification settings - Fork 37
fix: set "compress_to_zip" compress level to 0 #363
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
fix: set "compress_to_zip" compress level to 0 #363
Conversation
Log: as title
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the default compression level for the 'compress to zip/7z' startup path so that ZIP archives are created with compression level 0 instead of 1 when finishing size calculation. Class diagram for updated compression level behavior in MainWindowclassDiagram
class MainWindow {
- StartupType m_eStartupType
- CompressSettingPage m_pCompressSettingPage
+ slotFinishCalculateSize(size qint64, strArchiveFullPath QString, listAddEntry QList_FileEntry, stOptions CompressOptions, listAllEntry QList_FileEntry) void
}
class CompressOptions {
int iCompressionLevel
...
}
class StartupType {
<<enumeration>>
ST_Compresstozip7z
...
}
class CompressSettingPage {
+ isOrderMode() bool
...
}
MainWindow --> CompressOptions : uses
MainWindow --> StartupType : reads
MainWindow --> CompressSettingPage : uses
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 numbers for
iCompressionLevel(e.g.,0,1) with named constants or an enum to make the intended behavior and semantics of each level clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider replacing the magic numbers for `iCompressionLevel` (e.g., `0`, `1`) with named constants or an enum to make the intended behavior and semantics of each level clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
/merge |
deepin pr auto review这段代码的修改将压缩级别从 1. 语法与逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
总结与改进建议结论:除非有非常明确的业务需求(例如:用户明确选择了“极速模式”且该模式定义为“仅打包不压缩”,或者这是一个内部测试用的临时修改),否则不建议将默认压缩级别强制改为 改进建议:
修改后的代码示例(如果必须保留该逻辑): // 假设在头文件中定义了常量
// const int COMPRESSION_LEVEL_STORE = 0;
void MainWindow::slotFinishCalculateSize(qint64 size, QString strArchiveFullPath, QList<FileEntry> listAddEntry, CompressOptions stOptions, QList<FileEntry> listAllEntry)
{
if (StartupType::ST_Compresstozip7z == m_eStartupType) {
// 使用命名常量,并添加注释解释原因
// 针对特定启动类型,强制使用存储模式以提升处理速度
stOptions.iCompressionLevel = COMPRESSION_LEVEL_STORE;
#ifdef DTKCORE_CLASS_DConfigFile
if (m_pCompressSettingPage->isOrderMode()) {
// ...
}
#endif
}
// ... 后续逻辑
} |
Log: as title
Summary by Sourcery
Bug Fixes: