X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=base%2Fdali-toolkit%2Fpublic-api%2Ffocus-manager%2Fkeyinput-focus-manager.cpp;h=b81e8071dcdaf587233fe527d95dbcceea65db63;hb=c11191b4322a0687606b3e7f05db0a31f85403cc;hp=f427283b07346ee7712b525adaaf41996dbb1159;hpb=a881757839b7abb008873a68c67e17b3ba39669b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/base/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp b/base/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp index f427283..b81e807 100644 --- a/base/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp +++ b/base/dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp @@ -47,19 +47,22 @@ KeyInputFocusManager KeyInputFocusManager::Get() KeyInputFocusManager manager; // Check whether the focus manager is already created - Dali::Adaptor& adaptor = Dali::Adaptor::Get(); - Dali::BaseHandle handle = adaptor.GetSingleton(typeid(KeyInputFocusManager)); - if(handle) + SingletonService singletonService( SingletonService::Get() ); + if ( singletonService ) { - // If so, downcast the handle of singleton to focus manager - manager = KeyInputFocusManager(dynamic_cast(handle.GetObjectPtr())); - } - - if(!manager) - { - // If not, create the focus manager and register it as a singleton - manager = KeyInputFocusManager(new Internal::KeyInputFocusManager()); - adaptor.RegisterSingleton(typeid(manager), manager); + Dali::BaseHandle handle = singletonService.GetSingleton(typeid(KeyInputFocusManager)); + if(handle) + { + // If so, downcast the handle of singleton to focus manager + manager = KeyInputFocusManager(dynamic_cast(handle.GetObjectPtr())); + } + + if(!manager) + { + // If not, create the focus manager and register it as a singleton + manager = KeyInputFocusManager(new Internal::KeyInputFocusManager()); + singletonService.Register(typeid(manager), manager); + } } return manager;