Repository navigation
fix: strip fractional seconds from 7z time field - #507
Merged
deepin-bot[bot] merged 1 commit intoOct 14, 2026
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe 7z plugin now truncates fractional seconds from newer 7-Zip -slt Modified fields before QDateTime parsing, preventing invalid timestamps from displaying as 1970/01/01 while retaining compatibility with older archives. Sequence diagram for 7z modified time parsingsequenceDiagram
participant SevenZip as 7-Zip -slt
participant Plugin as Cli7zPlugin
participant DateTime as QDateTime
participant Entry as FileEntry
SevenZip->>Plugin: readListLine(line)
Plugin->>Plugin: modifiedTime.indexOf('.')
opt fractional seconds present
Plugin->>Plugin: modifiedTime.truncate(dotIndex)
end
Plugin->>DateTime: fromString(modifiedTime, yyyy-MM-dd hh:mm:ss)
DateTime-->>Plugin: valid parsed time
Plugin->>Entry: set uLastModifiedTime
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Root cause: new 7-Zip (24.09+) -slt output includes fractional seconds in Modified field (e.g. 2025-06-04 11:11:04.8826983), QDateTime::fromString with "yyyy-MM-dd hh:mm:ss" fails to parse, returning invalid QDateTime whose toSecsSinceEpoch returns 0 2. Fix: truncate the fractional seconds part before calling QDateTime::fromString, compatible with both old and new 7-Zip 3. Impact: only affects 7z archive Modified time parsing, no behavior change for archives without fractional seconds Log: Fix 7z archive modified time displaying as 1970/01/01 Influence: 1. Test opening 7z archives created by new 7-Zip (24.09+) 2. Verify modified time displays correctly instead of 1970/01/01 3. Test opening 7z archives created by old 7-Zip for no regression fix: 截断7z修改时间字段的小数秒部分 1. 根因:新版 7-Zip (24.09+) 的 -slt 输出中 Modified 字段带小数秒 (如 2025-06-04 11:11:04.8826983),QDateTime::fromString 使用 "yyyy-MM-dd hh:mm:ss" 格式解析失败返回无效 QDateTime, toSecsSinceEpoch 返回 0 即 1970/01/01 2. 方案:在调用 QDateTime::fromString 前截断小数秒部分(小数点及 之后),兼容新旧两种 7-Zip 时间格式 3. 影响:仅影响 7z 压缩包 Modified 时间解析,对旧版 7-Zip 无小数秒 输出完全向后兼容 Log: 修复7z压缩包修改时间显示为1970/01/01的问题 Influence: 1. 测试使用新版 7-Zip (24.09+) 创建的 7z 压缩包 2. 验证修改时间正确显示而非 1970/01/01 3. 测试旧版 7-Zip 创建的 7z 压缩包无回归 PMS: BUG-378795 multica: V-5746
pengfeixx
force-pushed
the
agent/pms-bug-bot/487cf764cf7d
branch
from
October 14, 2026 02:13
82db3cc to
4cd2674
Compare
lzwind
approved these changes
Oct 14, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, 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 |
Contributor
Author
|
/merge |
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: strip fractional seconds from 7z time field
seconds in Modified field (e.g. 2025-06-04 11:11:04.8826983),
QDateTime::fromString with "yyyy-MM-dd hh:mm:ss" fails to parse,
returning invalid QDateTime whose toSecsSinceEpoch returns 0
QDateTime::fromString, compatible with both old and new 7-Zip
change for archives without fractional seconds
Log: Fix 7z archive modified time displaying as 1970/01/01
Influence:
fix: 截断7z修改时间字段的小数秒部分
(如 2025-06-04 11:11:04.8826983),QDateTime::fromString 使用
"yyyy-MM-dd hh:mm:ss" 格式解析失败返回无效 QDateTime,
toSecsSinceEpoch 返回 0 即 1970/01/01
之后),兼容新旧两种 7-Zip 时间格式
输出完全向后兼容
Log: 修复7z压缩包修改时间显示为1970/01/01的问题
Influence:
PMS: BUG-378795
Summary by Sourcery
Bug Fixes: