Remove timer in AlbumListForm
authorHyukSoon Choi <hs619.choi@samsung.com>
Mon, 18 Mar 2013 10:48:37 +0000 (19:48 +0900)
committerHyukSoon Choi <hs619.choi@samsung.com>
Mon, 18 Mar 2013 10:48:37 +0000 (19:48 +0900)
Change-Id: I4f406c57aaa0eeb47cbcc6c59052981069ec817f
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
inc/GlAlbumListForm.h
src/GlAlbumListForm.cpp

index 134d19f..fe4897d 100644 (file)
@@ -35,7 +35,6 @@
 class AlbumListPresentationModel;
 class AlbumListForm
        : public BaseForm
-       , public Tizen::Base::Runtime::ITimerEventListener
        , public Tizen::Ui::IActionEventListener
        , public Tizen::Ui::Controls::IFormBackEventListener
        , public Tizen::Ui::Controls::IIconListViewItemEventListener
@@ -53,8 +52,6 @@ public:
        virtual result OnTerminating(void);
        virtual void OnUpdateContentList(void);
 
-       virtual void OnTimerExpired(Tizen::Base::Runtime::Timer &timer);
-
        virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
 
        virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
@@ -84,7 +81,6 @@ private:
        Tizen::Ui::Controls::IconListView* __pAlbumViewIconList;
        Tizen::Ui::Controls::ContextMenu* __pContextMenuMore;
        int __itemCount;
-       Tizen::Base::Runtime::Timer* __pTimer;
        AlbumListPresentationModel* __pPresentationModel;
 };
 
index ec11af7..2658145 100644 (file)
@@ -46,7 +46,6 @@ AlbumListForm::AlbumListForm(void)
        : __pAlbumViewIconList(null)
        , __pContextMenuMore(null)
        , __itemCount(0)
-       , __pTimer(null)
        , __pPresentationModel(null)
 {
        AppLogDebug("ENTER");
@@ -116,13 +115,6 @@ AlbumListForm::OnInitializing(void)
 
        __itemCount = __pPresentationModel->GetFolderCount();
        CreateIconListView();
-
-       if (__itemCount == 0)
-       {
-               __pTimer = new (std::nothrow) Timer();
-               __pTimer->Construct(*this);
-               __pTimer->Start(1000);
-       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return r;
@@ -346,58 +338,12 @@ AlbumListForm::OnTerminating(void)
                delete __pContextMenuMore;
                __pContextMenuMore = null;
        }
-
-       if (__pTimer != null)
-       {
-               __pTimer->Cancel();
-               delete __pTimer;
-               __pTimer = null;
-       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
 }
 
 void
-AlbumListForm::OnTimerExpired(Timer &timer)
-{
-       AppLogDebug("ENTER");
-       if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
-       {
-               if (__pPresentationModel->GetAppControlMediaType() == APPCONTROL_MEDIA_TYPE_IMAGE)
-               {
-                       __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_IMAGE);
-               }
-               else if (__pPresentationModel->GetAppControlMediaType() == APPCONTROL_MEDIA_TYPE_VIDEO)
-               {
-                       __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_VIDEO);
-               }
-               else
-               {
-                       __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_VIDEO);
-               }
-       }
-       else
-       {
-               __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_ALL);
-       }
-
-       __itemCount = __pPresentationModel->GetFolderCount();
-
-       static int timerCount = 0;
-       if (__itemCount > 1)
-       {
-               __pAlbumViewIconList->UpdateList();
-       }
-       else if (timerCount < 30)
-       {
-               __pTimer->Start(1000);
-               ++timerCount;
-       }
-       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-}
-
-void
 AlbumListForm::OnActionPerformed(const Control& source, int actionId)
 {
        AppLogDebug("ENTER");