Repository navigation
Conversation
1. Root cause: new 7-Zip (24.09+/26.x) -slt output includes fractional seconds in "Modified" field (e.g. 2025-06-04 11:11:04.8826983), QDateTime::fromString with format "yyyy-MM-dd hh:mm:ss" fails to parse, returns invalid QDateTime 2. Fix: truncate the fractional seconds part (dot and after) before calling fromString, so both old and new 7-Zip time formats work 3. Impact: archive Modified time now displays correctly instead of 1970/01/01; no effect on archives without fractional seconds Log: Fix archive file Modified time showing as 1970/01/01 Influence: 1. Test opening 7z archives created by new 7-Zip with fractional seconds in Modified field 2. Test opening 7z archives created by old 7-Zip without fractional seconds 3. Verify Modified time displays correctly for various archive types fix: 截断7-Zip Modified时间字段的小数秒部分 1. 根因:新版7-Zip(24.09+/26.x)的-slt输出中"Modified"字段带小数秒 (如2025-06-04 11:11:04.8826983),QDateTime::fromString使用 "yyyy-MM-dd hh:mm:ss"格式解析失败,返回无效QDateTime 2. 方案:在调用fromString前截断小数秒部分(小数点及之后内容), 兼容新旧两种7-Zip时间格式 3. 影响:修复后压缩包修改时间正常显示,不再显示为1970/01/01; 对不含小数秒的旧格式压缩包无影响 Log: 修复压缩包文件修改时间显示为1970/01/01的问题 Influence: 1. 测试使用新版7-Zip创建的带小数秒Modified字段的7z压缩包 2. 测试使用旧版7-Zip创建的不带小数秒的7z压缩包 3. 验证各种压缩包类型的修改时间显示正确 PMS: BUG-378795
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pengfeixx 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 GuideUpdates 7-Zip Modified-time parsing to truncate fractional seconds before applying the existing second-precision format, preventing invalid dates and restoring correct archive timestamps for both new and legacy 7-Zip output. Sequence diagram for 7-Zip Modified time parsingsequenceDiagram
participant SevenZip as 7-Zip
participant Plugin as Cli7zPlugin
participant Qt as QDateTime
SevenZip->>Plugin: readListLine(line)
Plugin->>Plugin: line.mid(11).trimmed()
opt fractional seconds present
Plugin->>Plugin: modifiedTime.truncate(dotIndex)
end
Plugin->>Qt: fromString(modifiedTime, yyyy-MM-dd hh:mm:ss)
Qt-->>Plugin: valid archive Modified time
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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: truncate fractional seconds in 7-Zip Modified time
fractional seconds in "Modified" field (e.g. 2025-06-04
11:11:04.8826983), QDateTime::fromString with format
"yyyy-MM-dd hh:mm:ss" fails to parse, returns invalid QDateTime
calling fromString, so both old and new 7-Zip time formats work
1970/01/01; no effect on archives without fractional seconds
Log: Fix archive file Modified time showing as 1970/01/01
Influence:
seconds in Modified field
seconds
fix: 截断7-Zip Modified时间字段的小数秒部分
(如2025-06-04 11:11:04.8826983),QDateTime::fromString使用
"yyyy-MM-dd hh:mm:ss"格式解析失败,返回无效QDateTime
兼容新旧两种7-Zip时间格式
对不含小数秒的旧格式压缩包无影响
Log: 修复压缩包文件修改时间显示为1970/01/01的问题
Influence:
PMS: BUG-378795
Summary by Sourcery
Ensure 7-Zip archive Modified timestamps are parsed correctly across timestamp formats.
Bug Fixes:
Enhancements: