From 6f27d74c224ecc433750c6fabe616880c123a352 Mon Sep 17 00:00:00 2001 From: "jungmin76.park" Date: Tue, 2 Apr 2013 20:05:53 +0900 Subject: [PATCH] fix add shortcut problem Change-Id: Id7d0bd29400f51231a3028bcfec920e2f564bec3 Signed-off-by: jungmin76.park --- src/core/FShell_ShortcutManagerImpl.cpp | 18 +++++++++++++++++- src/inc/FShell_ShortcutManagerImpl.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/core/FShell_ShortcutManagerImpl.cpp b/src/core/FShell_ShortcutManagerImpl.cpp index 95e7cba..22891b0 100644 --- a/src/core/FShell_ShortcutManagerImpl.cpp +++ b/src/core/FShell_ShortcutManagerImpl.cpp @@ -39,6 +39,7 @@ using namespace Tizen::App; request_cb_t __pAppWidgetRequestHandlerCallback = null; _ShortcutManagerImpl::_ShortcutManagerImpl() + : __isListenerConstructed(false) { } @@ -122,21 +123,32 @@ int ShortcutRequestEventReceiverCB(const char* appId, const char* text, int type result _ShortcutManagerImpl::Construct() { + return E_SUCCESS; +} + +result +_ShortcutManagerImpl::ConstructListener() +{ int ret = shortcut_set_request_cb(ShortcutRequestEventReceiverCB, this ); SysTryReturnResult(NID_SHELL, ret == 0, E_SYSTEM, "failed to shortcut_set_request_cb (%d)", ret); __shortcutRequestListenerList.Construct(); + + __isListenerConstructed = true; SysLog(NID_SHELL, "Successed."); return E_SUCCESS; } - result _ShortcutManagerImpl::AddShortcutRequestListener(IShortcutRequestListener& listener) { SysTryReturnResult(NID_SHELL, !__shortcutRequestListenerList.Contains(&listener), E_OBJ_ALREADY_EXIST, "The listener is already added."); SysLog(NID_SHELL, "(%x)", &listener); + if( __isListenerConstructed == false) + { + ConstructListener(); + } return __shortcutRequestListenerList.Add(&listener); } @@ -156,6 +168,10 @@ _ShortcutManagerImpl::GetShortcutRequestListenerList(void) const void _ShortcutManagerImpl::SetAppWidgetRequestHandlerCallback(request_cb_t pAppWidgetRequestHandlerFn) { + if( __isListenerConstructed == false) + { + ConstructListener(); + } __pAppWidgetRequestHandlerCallback = pAppWidgetRequestHandlerFn; } diff --git a/src/inc/FShell_ShortcutManagerImpl.h b/src/inc/FShell_ShortcutManagerImpl.h index 744ac2e..5471934 100644 --- a/src/inc/FShell_ShortcutManagerImpl.h +++ b/src/inc/FShell_ShortcutManagerImpl.h @@ -118,9 +118,11 @@ private: _ShortcutManagerImpl(void); virtual ~_ShortcutManagerImpl(void); result Construct(void); + result ConstructListener(void); private: Tizen::Base::Collection::ArrayListT __shortcutRequestListenerList; + bool __isListenerConstructed; }; }} // Tizen::Shell -- 2.7.4