From: luozheng <1732036298@qq.com> Date: Sat, 22 Jun 2024 08:27:58 +0000 (+0800) Subject: 显示与方式Model补交 X-Git-Tag: release_V1.2.70_20241020_135402~966 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=e1d0601fe710d0a5d8846a094f8f075c80ecc6ad;p=mirrors%2FFD230.git 显示与方式Model补交 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp index 58ba50568..98610024a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/themestyle/src/ThemeStyleModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-07 09:21:47 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-22 15:10:07 + * @LastEditTime: 2024-06-22 16:15:02 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/set_desktop/src/ThemeStyleModel.cpp */ @@ -31,7 +31,12 @@ namespace OHOS WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThemeStyleModel::GetAppListDisplayStyle"); char temp[STYLE_VALUE_LEN] = {0}; - (void)UtilsGetValue(THEMESTYLE_KEY, temp, STYLE_VALUE_LEN); // 从文件系统或缓存中获取与指定键匹配的值。 + int ret = UtilsGetValue(THEMESTYLE_KEY, temp, STYLE_VALUE_LEN); // 从文件系统或缓存中获取与指定键匹配的值。 + if (ret != EC_SUCCESS) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UtilsGetValue error,temp:%s,ret = %d", temp, ret); + return ThemeStyle::APPLIST_STYLE; + } // 检查是否存在对应的样式选项 auto it = ReverseThemeStyleMap.find(std::string(temp)); @@ -55,11 +60,14 @@ namespace OHOS // 检查是否存在对应的样式选项 if (ThemeStyleMap.find(style) != ThemeStyleMap.end()) { + const char *value = THEMESTYLE_KEY; + const char *key = ThemeStyleMap.at(style).c_str(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "value:%s,key:%s", value, key); // 根据映射设置显示样式值 - int ret = UtilsSetValue(THEMESTYLE_KEY, ThemeStyleMap.at(style).c_str()); + int ret = UtilsSetValue(value, key); if (ret != EC_SUCCESS) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UtilsSetValue error,ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UtilsSetValue error,ret = %d", ret); return; } }