Arrange code
[apps/osp/Gallery.git] / src / GlFileMoveTimer.cpp
index 5fe57ef..557a7f3 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
@@ -42,6 +42,7 @@ FileMoveTimer::FileMoveTimer(String& destDirectory, IList* list, FileListPresent
        : GlTimerBase(pInvalidate, FILE_ACTION_MOVE)
        , __pMoveIndexList(list)
        , __moveToDir(destDirectory)
+       , __isCopyOperation(false)
        , __pPresentationModel(presentationModel)
 {
 }
@@ -93,7 +94,8 @@ result FileMoveTimer::TimerExpired(const Object* contentId)
 void FileMoveTimer::TimerCancel(int, enum FileActionCancelRes res)
 {
        AppLogDebug("ENTER");
-       if (res == CANCEL_USER)
+
+       if (res == CANCEL_USER || (res == CANCEL_SYS_ERROR && GetMovedCount() > 0))
        {
                String albumName = __pPresentationModel->ConvertToAlbumName(__moveToDir);
 
@@ -109,6 +111,17 @@ void FileMoveTimer::TimerCancel(int, enum FileActionCancelRes res)
                        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
                }
        }
+       else if (res == CANCEL_SYS_ERROR && GetMovedCount() == 0)
+       {
+               if (__isCopyOperation == true)
+               {
+                       MessageBox messageBox;
+                       messageBox.Construct(L"", L"Unable to copy files.",
+                                       MSGBOX_STYLE_NONE, 3000);
+                       int modalResult;
+                       messageBox.ShowAndWait(modalResult);
+               }
+       }
        AppLogDebug("EXIt");
 }