Fixed issue 39990
authorHimanshu Talwar <himanshu.t@samsung.com>
Thu, 30 May 2013 10:44:30 +0000 (16:14 +0530)
committerHimanshu Talwar <himanshu.t@samsung.com>
Thu, 30 May 2013 10:44:30 +0000 (16:14 +0530)
Change-Id: Ib8510e709864ef8373e08d608f7ce4c88816a884
Signed-off-by: Himanshu Talwar <himanshu.t@samsung.com>
inc/GlTimerBase.h
src/GlAlbumNameEditorForm.cpp
src/GlTimerBase.cpp

index 0eeefaf..99911c1 100644 (file)
@@ -43,6 +43,10 @@ public:
        virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
 
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
+
+       void Cancel(void);
+       bool IsStarted(void);
+
        int GetMovedCount() const;
 
 protected:
@@ -64,6 +68,7 @@ private:
        int __moveToCount;
        GlProgressBar* __pMoveProBar;
        IFileOpInvalidateListener* __pInvalidate;
+       bool __isStarted;
  };
 
 #endif //_GL_TIMER_BASE_H_
index 3669f38..d0c97cb 100644 (file)
@@ -642,6 +642,12 @@ AlbumNameEditorForm::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Ba
 
        if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED)
        {
+               if ( __pFileMove && __pFileMove->IsStarted() )
+               {
+                       __pFileMove->Cancel();
+                       delete __pFileMove;
+                       __pFileMove = null;
+               }
                __mountState = false;
                SceneManager* pSceneManager = SceneManager::GetInstance();
                pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
index d7a97c1..044f994 100644 (file)
@@ -36,6 +36,7 @@ GlTimerBase::GlTimerBase(IFileOpInvalidateListener* invalidateListener, enum Fil
        , __moveToCount(0)
        , __pMoveProBar(null)
        , __pInvalidate(invalidateListener)
+       , __isStarted(false)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -45,11 +46,14 @@ GlTimerBase::~GlTimerBase(void)
 {
        AppLogDebug("ENTER");
        __pInvalidate = null;
-       if (__pContentIdList != null && __pContentIdList->GetCount() > 0)
+       if (__pContentIdList != null && __pContentIdList->GetCount() > 0 && __isStarted)
        {
                __moveTimer.Cancel();
+               __isStarted = false;
        }
        delete __pContentIdList;
+       __pMoveProBar->HideFileProgressingPopup();
+       delete __pMoveProBar;
        AppLogDebug("ENTER");
 }
 
@@ -66,6 +70,7 @@ GlTimerBase::StartTimer(void)
                __moveToCount = 0;
                __moveTimer.Construct(*this);
                __moveTimer.Start(1);
+               __isStarted = true;
                ContentUpdateEventListener* pContentListener = ContentUpdateEventListener::GetInstance();
                pContentListener->RemoveContentListener();
                AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -80,6 +85,7 @@ GlTimerBase::CancelTimer(void)
 {
        AppLogDebug("ENTER");
        __moveTimer.Cancel();
+       __isStarted = false;
        OnOpCancelled(CANCEL_USER);
        __moveToCount = 0;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -112,10 +118,12 @@ GlTimerBase::OnTimerExpired(Timer& timer)
                                __pInvalidate->OnFileOpInvalidate(_actionId);
                        }
                        __moveTimer.Start(1);
+                       __isStarted = true;
                }
                else
                {
                        __moveTimer.Cancel();
+                       __isStarted = false;
                        OnOpComplete(COMPLETE_SUCCESS);
                        __moveToCount = 0;
                }
@@ -207,3 +215,20 @@ void GlTimerBase::SetActionMode(const enum FileActionMode actionId)
 {
        _actionId = actionId;
 }
+
+
+bool GlTimerBase::IsStarted(void)
+{
+       return __isStarted;
+}
+
+void GlTimerBase::Cancel(void)
+{
+       if ( __isStarted )
+       {
+               __pMoveProBar->HideFileProgressingPopup();
+               __moveTimer.Cancel();
+               __isStarted = false;
+       }
+
+}