From 8cfd24a7772025eb3e3ac66735b448e043a2f2aa Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Thu, 30 May 2024 14:55:55 +0800 Subject: [PATCH] =?utf8?q?rebootdevice=20=E6=96=87=E4=BB=B6=E5=A4=B9?= =?utf8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../rebootdevice/include/RebootModel.h | 2 +- .../rebootdevice/src/RebootDeviceView.cpp | 2 +- .../nativeui/rebootdevice/src/RebootView.cpp | 29 +++++++++---------- .../rebootdevice/src/ShutdownDeviceView.cpp | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h index 5c14f77a5..915652f34 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h @@ -16,7 +16,7 @@ enum RebootModelView : uint8_t { SHUTDOWNDEVICE, }; -using namespace std; + class RebootModel { public: ~RebootModel(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp index cad3c66a5..97775804b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootDeviceView.cpp @@ -95,7 +95,7 @@ UIViewGroup *RebootDeviceView::InitShowUpView(void) group->SetHeight(VERTICAL_RESOLUTION); } ret = ShowUpRebootDeviceView(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(rebootDeviceLabel); diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp index 8e5c9c974..f32328935 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootView.cpp @@ -251,13 +251,13 @@ namespace OHOS UNUSED(hideView); if (container[thisView] == nullptr) { - UIViewGroup *group = InitShowUpView(); - if (group == nullptr) + UIViewGroup *viewGroup = InitShowUpView(); + if (viewGroup == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group nullptr fail"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewGroup nullptr fail"); return false; } - container[thisView] = group; + container[thisView] = viewGroup; RootView::GetInstance()->Add(container[thisView]); } return true; @@ -279,13 +279,12 @@ namespace OHOS return false; } // init view - UIViewGroup *group = rebootDeviceView->InitShowUpView(); - if (group == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group nullptr fail"); + UIViewGroup *viewGroup = rebootDeviceView->InitShowUpView(); + if (viewGroup == nullptr) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewGroup nullptr fail"); return false; } - container[thisView] = group; + container[thisView] = viewGroup; RootView::GetInstance()->Add(container[thisView]); } return true; @@ -307,13 +306,13 @@ namespace OHOS return false; } // init view - UIViewGroup *group = shutdownDeviceView->InitShowUpView(); - if (group == nullptr) + UIViewGroup *viewGroup = shutdownDeviceView->InitShowUpView(); + if (viewGroup == nullptr) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group nullptr fail"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewGroup nullptr fail"); return false; } - container[thisView] = group; + container[thisView] = viewGroup; RootView::GetInstance()->Add(container[thisView]); } return true; @@ -373,7 +372,7 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootView::ChangeView %d, %d", hideView, showView); - if (CheckViewParam(hideView, showView) == false) + if (!CheckViewParam(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootView::CheckViewParam failed."); return; @@ -381,7 +380,7 @@ namespace OHOS PreprosssChangeView tmpPreProcessView = preProcessView[showView]; - if ((this->*tmpPreProcessView)(hideView, showView) == false) + if (!(this->*tmpPreProcessView)(hideView, showView)) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootView::ChangeView %d %dfailed", showView, hideView); return; diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp index a56f9fdae..775d5ecf0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/ShutdownDeviceView.cpp @@ -97,7 +97,7 @@ UIViewGroup *ShutdownDeviceView::InitShowUpView(void) } ret = ShowUpShutdownDeviceView(); - if (ret == false) { + if (!ret) { return nullptr; } group->Add(shutdownDeviceLabel); -- 2.17.1