Remove unnessaceery event listener processing.
authorChangyong Jeon <fin10.jeon@samsung.com>
Thu, 30 May 2013 02:42:28 +0000 (11:42 +0900)
committerChangyong Jeon <fin10.jeon@samsung.com>
Thu, 30 May 2013 02:42:28 +0000 (11:42 +0900)
Change-Id: I3b9df512b4b2979641f9014fb519b7a95de0f827

inc/ClSharePopup.h
inc/ClThreeButtonPopup.h
inc/ClTwoButtonPopup.h
manifest.xml
src/ClSharePopup.cpp
src/ClThreeButtonPopup.cpp
src/ClTwoButtonPopup.cpp

index 1ee7777..f7e7fc6 100644 (file)
@@ -58,7 +58,7 @@ public:
        virtual void OnCalendarTodosChanged(const Tizen::Base::Collection::IList &todoChangeInfoList);
 
 private:
-       Tizen::Social::Calendarbook __calendarbook;
+       Tizen::Social::Calendarbook* __pCalendarbook;
        Tizen::Social::RecordId __eventId;
 }; // SharePopup
 
index 17c849b..f35fb3a 100644 (file)
@@ -51,7 +51,7 @@ private:
        int __buttonOnlyThisActionId;
        int __buttonAllEventsActionId;
        Tizen::Ui::Control* __pTarget;
-       Tizen::Social::Calendarbook __calendarbook;
+       Tizen::Social::Calendarbook* __pCalendarbook;
        Tizen::Social::CalEventInstance* __pEvent;
 }; // ThreeButtonPopup
 
index 4b276a7..42fa96c 100644 (file)
@@ -49,7 +49,7 @@ public:
 private:
        Tizen::Base::String __title;
        Tizen::Ui::Control* __pTarget;
-       Tizen::Social::Calendarbook __calendarbook;
+       Tizen::Social::Calendarbook* __pCalendarbook;
        Tizen::Social::CalEventInstance* __pEvent;
 }; // TwoButtonPopup
 
index d08bb38..87068d5 100644 (file)
@@ -6,6 +6,7 @@
     <Requirements>
         <Feature Name="http://tizen.org/feature/platform.core.cpu.arch.armv7">true</Feature>
         <Feature Name="http://tizen.org/feature/platform.core.fpu.arch.vfpv3">true</Feature>
+        <Feature Name="http://tizen.org/feature/screen.size.normal">true</Feature>
     </Requirements>
     <Apps>
         <ApiVersion>2.1</ApiVersion>
@@ -85,8 +86,8 @@
                     <Operation>http://tizen.org/appcontrol/operation/social/view</Operation>
                 </AppControl>
                 <AppControl>
-                    <MimeType>text/x-vcalendar</MimeType>
                     <MimeType>text/calendar</MimeType>
+                    <MimeType>text/x-vcalendar</MimeType>
                     <Operation>http://tizen.org/appcontrol/operation/view</Operation>
                 </AppControl>
             </AppControls>
index 553b5e3..e410acb 100644 (file)
@@ -45,7 +45,8 @@ static const int IDA_SHARE_POPUP_CLOSE = 63010;
 static const int H_ITEM = 110;
 
 SharePopup::SharePopup(void)
-       : __eventId(INVALID_RECORD_ID)
+       : __pCalendarbook(null)
+       , __eventId(INVALID_RECORD_ID)
 {
 }
 
@@ -56,13 +57,7 @@ SharePopup::~SharePopup(void)
 result
 SharePopup::Initialize(void)
 {
-       result r = Construct(L"IDL_SHARE_POPUP");
-       if (!IsFailed(r))
-       {
-               __calendarbook.Construct(*this);
-       }
-
-       return r;
+       return Construct(L"IDL_SHARE_POPUP");
 }
 
 result
@@ -77,6 +72,9 @@ result
 SharePopup::OnInitializing(void)
 {
        AppLogDebug("Enter");
+       __pCalendarbook = new (std::nothrow) Calendarbook();
+       __pCalendarbook->Construct(*this);
+
        ListView* pListView = dynamic_cast<ListView*>(GetControl(L"IDC_LISTVIEW_SHARE"));
        pListView->SetItemProvider(*this);
        pListView->AddListViewItemEventListener(*this);
@@ -92,6 +90,8 @@ result
 SharePopup::OnTerminating(void)
 {
        AppLogDebug("Enter");
+       delete __pCalendarbook;
+       __pCalendarbook = null;
        return E_SUCCESS;
 }
 
@@ -146,9 +146,7 @@ SharePopup::OnListViewItemStateChanged(ListView& listView, int index, int elemen
                        return;
                }
 
-               Calendarbook calendarbook;
-               calendarbook.Construct();
-               CalEvent* pEvent = calendarbook.GetEventN(__eventId);
+               CalEvent* pEvent = __pCalendarbook->GetEventN(__eventId);
                if(!pEvent)
                {
                        AppLogException("[%s] Unable to get event.(ID=%d)", GetErrorMessage(GetLastResult()), __eventId);
@@ -168,7 +166,7 @@ SharePopup::OnListViewItemStateChanged(ListView& listView, int index, int elemen
                String* pPath = new (std::nothrow) String(CalendarApp::GetExportVcsFilePath());
                LinkedList events(SingleObjectDeleter);
                events.Add(pEvent);
-               calendarbook.ExportEventsToVcalendar(events, *pPath);
+               __pCalendarbook->ExportEventsToVcalendar(events, *pPath);
 
                ArrayList* pPaths = new (std::nothrow) ArrayList(SingleObjectDeleter);
                pPaths->Construct(1);
index f6fa164..c1ac015 100755 (executable)
@@ -34,6 +34,7 @@ static const int IDA_EVENT_POPUP_CANCEL = 11905;
 
 ThreeButtonPopup::ThreeButtonPopup(void)
        : __pTarget(null)
+       , __pCalendarbook(null)
        , __pEvent(null)
 {
 }
@@ -45,13 +46,7 @@ ThreeButtonPopup::~ThreeButtonPopup(void)
 result
 ThreeButtonPopup::Initialize(void)
 {
-       result r = Construct(L"IDL_THREE_BUTTON_POPUP");
-       if (!IsFailed(r))
-       {
-               __calendarbook.Construct(*this);
-       }
-
-       return r;
+       return Construct(L"IDL_THREE_BUTTON_POPUP");
 }
 
 void
@@ -83,6 +78,9 @@ ThreeButtonPopup::RequestPopup(ThreeButtonPopupStyle style, Control* pTarget, co
 result
 ThreeButtonPopup::OnInitializing(void)
 {
+       __pCalendarbook = new (std::nothrow) Calendarbook();
+       __pCalendarbook->Construct(*this);
+
        Label* pTitle = dynamic_cast<Label*>(GetControl(L"IDC_LABEL"));
        pTitle->SetText(__title);
 
@@ -104,6 +102,8 @@ ThreeButtonPopup::OnInitializing(void)
 result
 ThreeButtonPopup::OnTerminating(void)
 {
+       delete __pCalendarbook;
+       __pCalendarbook = null;
        return E_SUCCESS;
 }
 
index fc88107..fe34e76 100644 (file)
@@ -34,6 +34,7 @@ static const int IDA_EVENT_POPUP_CANCEL = 10902;
 
 TwoButtonPopup::TwoButtonPopup(void)
        : __pTarget(null)
+       , __pCalendarbook(null)
        , __pEvent(null)
 {
 }
@@ -45,13 +46,7 @@ TwoButtonPopup::~TwoButtonPopup(void)
 result
 TwoButtonPopup::Initialize(void)
 {
-       result r = Construct(L"IDL_TWO_BUTTON_POPUP");
-       if (!IsFailed(r))
-       {
-               __calendarbook.Construct(*this);
-       }
-
-       return r;
+       return Construct(L"IDL_TWO_BUTTON_POPUP");
 }
 
 void
@@ -81,6 +76,9 @@ TwoButtonPopup::RequestPopup(TwoButtonPopupStyle style, Control* pTarget, const
 result
 TwoButtonPopup::OnInitializing(void)
 {
+       __pCalendarbook = new (std::nothrow) Calendarbook();
+       __pCalendarbook->Construct(*this);
+
        AppLogDebug("Enter");
        Label* pTitle = dynamic_cast<Label*>(GetControl(L"IDC_LABEL"));
        AppAssertf(pTitle != null, "[E_FAILURE] Unable to get label.");
@@ -103,6 +101,8 @@ result
 TwoButtonPopup::OnTerminating(void)
 {
        AppLogDebug("Enter");
+       delete __pCalendarbook;
+       __pCalendarbook = null;
        return E_SUCCESS;
 }