Repository navigation
refactor: improve thememanager logging and date handling - #201
Merged
Merged
Conversation
1. Remove unused QDebug include from sunrisesunset.cpp 2. Cache date.startOfDay() to avoid redundant computation 3. Remove debug qInfo logging of raw sunrise/sunset calculations 4. Add detailed structured logging when auto theme change is triggered 5. Log includes theme transition, current time, coordinates, UTC offset, sunrise and sunset times The changes reduce unnecessary debug output while adding more informative logging at the point where theme changes are actually applied, making it easier to diagnose auto-theme behavior. Log: Improved auto theme switching diagnostics with detailed change logging Influence: 1. Verify auto theme switching still works correctly at sunrise and sunset boundaries 2. Confirm theme change logs contain accurate timestamps, coordinates, and theme names 3. Test behavior across different UTC offsets and extreme latitudes 4. Ensure no functional regression from removing the debug log line in sunrise/sunset calculation 5. Verify sunrise/sunset datetime values remain correct after refactoring startOfDay caching refactor: 改进主题管理器日志和日期处理 1. 移除 sunrisesunset.cpp 中未使用的 QDebug 头文件 2. 缓存 date.startOfDay() 避免重复计算 3. 移除日出日落原始计算的调试日志 4. 在自动主题切换触发时添加详细的结构化日志 5. 日志包含主题切换、当前时间、坐标、UTC 偏移、日出和日落时间 这些改动减少了不必要的调试输出,同时在主题实际切换处添加了更有信息量的日 志,便于诊断自动主题切换行为。 Log: 通过详细的切换日志改进自动主题切换诊断能力 Influence: 1. 验证自动主题切换在日出和日落边界仍能正常工作 2. 确认主题切换日志包含准确的时间戳、坐标和主题名称 3. 测试不同 UTC 偏移和极端纬度下的行为 4. 确保移除日出日落计算中的调试日志未造成功能回归 5. 验证重构 startOfDay 缓存后日出日落时间值仍然正确
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR refactors sunrise/sunset datetime calculation to reuse a cached start-of-day value and removes noisy raw-calculation logging, while adding a detailed ISO-formatted diagnostic record immediately before each automatic theme transition is applied. Sequence diagram for automatic theme change diagnosticssequenceDiagram
participant ThemeManager
participant SunriseSunset
participant Logger
participant SystemTheme
ThemeManager->>SunriseSunset: getSunriseSunset(latitude, longitude, utcOffset)
SunriseSunset-->>ThemeManager: sunrise, sunset
ThemeManager->>Logger: qInfo Auto theme change requested
ThemeManager->>SystemTheme: doSetGlobalTheme(themeType)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
mhduiy
approved these changes
Oct 20, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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
|
/forcemerge |
|
This pr force merged! (status: blocked) |
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.
sunrise and sunset times
The changes reduce unnecessary debug output while adding more
informative logging at the point where theme changes are actually
applied, making it easier to diagnose auto-theme behavior.
Log: Improved auto theme switching diagnostics with detailed change
logging
Influence:
sunset boundaries
and theme names
sunrise/sunset calculation
refactoring startOfDay caching
refactor: 改进主题管理器日志和日期处理
这些改动减少了不必要的调试输出,同时在主题实际切换处添加了更有信息量的日
志,便于诊断自动主题切换行为。
Log: 通过详细的切换日志改进自动主题切换诊断能力
Influence:
Summary by Sourcery
Improve automatic theme switching diagnostics while simplifying sunrise and sunset date calculations.
Enhancements:
Chores: