Skip to content

Commit be1d4ae

Browse files
committed
fix(notification): expand screen lock init condition for unit tests
1. Added fallback condition to call initScreenLockedState() when platform name is non-empty, ensuring the function runs on Wayland as well 2. Previously skipped on Wayland only; now also handles empty platform name case that occurs in unit test environments 3. Marks intention for subsequent migration to the login1 interface Log: Expand screen lock initialization condition to work in unit test and Wayland environments fix(notification): 扩展屏幕锁定初始化条件以支持单元测试 1. 新增 platformName 非空时的回退条件,确保在 Wayland 上也能调用 initScreenLockedState() 2. 原先仅在 Wayland 时跳过;现在同时处理单元测试环境中 platformName 为空的情况 3. 标注了后续迁移至 login1 接口的意图 Log: 扩展屏幕锁定初始化条件,兼容单元测试和 Wayland 环境
1 parent 61e3d38 commit be1d4ae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

panels/notification/server/notificationmanager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ NotificationManager::NotificationManager(QObject *parent)
8181
if(!config->value("notificationCleanupDays").isNull()) {
8282
m_cleanupDays = config->value("notificationCleanupDays").toInt();
8383
}
84-
if (QStringLiteral("wayland") != QGuiApplication::platformName()) {
84+
if (QStringLiteral("wayland") != QGuiApplication::platformName()
85+
&& !QGuiApplication::platformName().isEmpty()) { // for unit test, Subsequent migration to the login1 interface
8586
initScreenLockedState();
8687
}
8788
}

0 commit comments

Comments
 (0)