diff options
| author | handsome_feng <445865575@qq.com> | 2015-10-23 17:09:01 +0800 |
|---|---|---|
| committer | handsome_feng <445865575@qq.com> | 2015-10-23 17:09:01 +0800 |
| commit | e6f8fcb1b055a91ad0896a6f27bbe1c0b92c99cf (patch) | |
| tree | 66295d17b97395814370e9f7bca7dc186355b109 /lockscreen | |
| parent | f31c087ac22c81a245c37d8d31ac04018e03f176 (diff) | |
used g_strcmp0 instead of strcmp, added two gtests
(bzr r4016.2.13)
Diffstat (limited to 'lockscreen')
| -rw-r--r-- | lockscreen/LockScreenAbstractPromptView.h | 5 | ||||
| -rw-r--r-- | lockscreen/LockScreenAbstractShield.h | 2 | ||||
| -rw-r--r-- | lockscreen/LockScreenController.cpp | 8 | ||||
| -rw-r--r-- | lockscreen/LockScreenShield.cpp | 1 | ||||
| -rw-r--r-- | lockscreen/LockScreenShieldFactory.cpp | 2 |
5 files changed, 6 insertions, 12 deletions
diff --git a/lockscreen/LockScreenAbstractPromptView.h b/lockscreen/LockScreenAbstractPromptView.h index 3c83bd372..c8fb749c9 100644 --- a/lockscreen/LockScreenAbstractPromptView.h +++ b/lockscreen/LockScreenAbstractPromptView.h @@ -54,16 +54,13 @@ public: nux::Property<double> scale; - virtual nux::View* focus_view() { return this; } + virtual nux::View* focus_view() = 0; -// virtual void AddPrompt(std::string const& message, bool visible, PromiseAuthCodePtr const& promise) = 0; -// virtual void AddMessage(std::string const& message, nux::Color const& color) = 0; virtual void AuthenticationCb(bool authenticated) = 0; virtual void Draw(nux::GraphicsEngine& graphics_engine, bool /* force_draw */) = 0; virtual void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) {} virtual void ResetLayout() = 0; virtual void UpdateSize() = 0; -// virtual void EnsureBGLayer() = 0; virtual bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character) = 0; diff --git a/lockscreen/LockScreenAbstractShield.h b/lockscreen/LockScreenAbstractShield.h index f68844c40..4843a00c4 100644 --- a/lockscreen/LockScreenAbstractShield.h +++ b/lockscreen/LockScreenAbstractShield.h @@ -32,7 +32,6 @@ namespace unity namespace lockscreen { -//class UserPromptView; class AbstractUserPromptView; class AbstractShield : public MockableBaseWindow @@ -41,7 +40,6 @@ public: AbstractShield(session::Manager::Ptr const& session, indicator::Indicators::Ptr const& indicators, Accelerators::Ptr const& accelerators, -// nux::ObjectPtr<UserPromptView> const& prompt_view, nux::ObjectPtr<AbstractUserPromptView> const& prompt_view, int monitor_num, bool is_primary) : MockableBaseWindow("Unity Lockscreen") diff --git a/lockscreen/LockScreenController.cpp b/lockscreen/LockScreenController.cpp index 3438af4e2..b44f7481c 100644 --- a/lockscreen/LockScreenController.cpp +++ b/lockscreen/LockScreenController.cpp @@ -218,16 +218,16 @@ void Controller::EnsureShields(std::vector<nux::Geometry> const& monitors) int primary = UScreen::GetDefault()->GetMonitorWithMouse(); // Keep a reference of the old prompt_view - nux::ObjectPtr<AbstractUserPromptView> prompt_view(prompt_view_.GetPointer()); + nux::ObjectPtr<AbstractUserPromptView> prompt_view(prompt_view_.GetPointer()); shields_.resize(num_monitors); if (!prompt_view) { - if (strcmp(getenv("KYLIN_CURRENT_DESKTOP"), "Kylin")) - prompt_view = test_mode_ ? nullptr : new UserPromptView(session_manager_); - else + if (g_strcmp0(getenv("KYLIN_CURRENT_DESKTOP"), "Kylin") == 0) prompt_view = test_mode_ ? nullptr : new KylinUserPromptView(session_manager_); + else + prompt_view = test_mode_ ? nullptr : new UserPromptView(session_manager_); prompt_view_ = prompt_view.GetPointer(); } diff --git a/lockscreen/LockScreenShield.cpp b/lockscreen/LockScreenShield.cpp index 6199981e1..d936b12f2 100644 --- a/lockscreen/LockScreenShield.cpp +++ b/lockscreen/LockScreenShield.cpp @@ -28,7 +28,6 @@ #include "LockScreenPanel.h" #include "LockScreenSettings.h" #include "LockScreenAbstractPromptView.h" - #include "unity-shared/UScreen.h" #include "unity-shared/UnitySettings.h" #include "unity-shared/WindowManager.h" diff --git a/lockscreen/LockScreenShieldFactory.cpp b/lockscreen/LockScreenShieldFactory.cpp index 6ad82ee6f..abd9866a0 100644 --- a/lockscreen/LockScreenShieldFactory.cpp +++ b/lockscreen/LockScreenShieldFactory.cpp @@ -33,7 +33,7 @@ nux::ObjectPtr<AbstractShield> ShieldFactory::CreateShield(session::Manager::Ptr nux::ObjectPtr<AbstractUserPromptView> const& prompt_view, int monitor, bool is_primary) { - if (!strcmp(getenv("KYLIN_CURRENT_DESKTOP"),"Kylin")) + if (g_strcmp0(getenv("KYLIN_CURRENT_DESKTOP"),"Kylin") == 0) return nux::ObjectPtr<KylinShield>(new KylinShield(session_manager, accelerators, prompt_view, monitor, is_primary)); else return nux::ObjectPtr<Shield>(new Shield(session_manager, indicators, accelerators, prompt_view, monitor, is_primary)); |
