Skip to content

Commit 80fe34c

Browse files
wjyrichdeepin-bot[bot]
authored andcommitted
fix: remove duplicate wallpaper blurhash assignment
1. Removed redundant assignment of m_wallpaperBlurhash variable in updateAllWallpaper() method 2. The blurhash value was already being stored in m_wallpaperBlurMap with wallpaperUrl as key 3. The updateCurrentWallpaperBlurhash() method properly handles setting the current blurhash from the map 4. This eliminates duplicate data storage and potential inconsistency between the two variables Influence: 1. Verify wallpaper blurhash functionality still works correctly 2. Test wallpaper switching and blurhash updates 3. Check that m_wallpaperBlurMap properly stores and retrieves blurhash values 4. Ensure no memory leaks or performance issues from the removed assignment fix: 移除重复的壁纸模糊哈希赋值 1. 在 updateAllWallpaper() 方法中移除了对 m_wallpaperBlurhash 变量的冗余 赋值 2. 模糊哈希值已经以 wallpaperUrl 为键存储在 m_wallpaperBlurMap 中 3. updateCurrentWallpaperBlurhash() 方法会正确地从映射中设置当前模糊哈希 4. 这消除了重复数据存储和两个变量之间潜在的不一致问题 Influence: 1. 验证壁纸模糊哈希功能仍然正常工作 2. 测试壁纸切换和模糊哈希更新 3. 检查 m_wallpaperBlurMap 是否正确存储和检索模糊哈希值 4. 确保移除赋值不会导致内存泄漏或性能问题 由于没有信号让页面更新,故将其删除,赋值操作采用如下方式处理: if (m_wallpaperBlurMap.contains(wallpaperUrl)) { QString newBlurhash = m_wallpaperBlurMap.value(wallpaperUrl); if (m_wallpaperBlurhash != newBlurhash) { m_wallpaperBlurhash = newBlurhash; emit wallpaperBlurhashChanged(); } PMS: BUG-289307
1 parent 12176f2 commit 80fe34c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/ddeintegration/appearance.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -168,7 +168,6 @@ void Appearance::updateAllWallpaper()
168168

169169
QString result(watcher->result());
170170
if (!result.isEmpty() && !m_wallpaperBlurMap.contains(wallpaperUrl)) {
171-
m_wallpaperBlurhash = result;
172171
m_wallpaperBlurMap[wallpaperUrl] = result;
173172
updateCurrentWallpaperBlurhash();
174173
}

0 commit comments

Comments
 (0)