IssueFix N_SE-37501
authorkamesh <kamesh.kvss@samsung.com>
Fri, 10 May 2013 11:03:46 +0000 (16:33 +0530)
committerkamesh <kamesh.kvss@samsung.com>
Fri, 10 May 2013 11:03:46 +0000 (16:33 +0530)
Change-Id: I80f3d8bb7af666f08d8c6e78ed621a192bd337b9

inc/GlAlbumListPresentationModel.h
src/GlAlbumListPresentationModel.cpp
src/GlContentUpdateEventListener.cpp
src/GlGalleryApp.cpp

index cc1f374..bb6c01b 100644 (file)
@@ -39,7 +39,6 @@ class AlbumListPresentationModel
        : public IContentFileUpdateManager
        , public IThumbnailEventListener
        , public Tizen::Base::Object
-       , public Tizen::Content::IContentScanListener
        , public Tizen::System::IDeviceEventListener
 {
 public:
@@ -77,7 +76,7 @@ public:
 
        virtual void OnThumbnailReceivedN(Tizen::Base::Runtime::IEventArg& eventArg);
 
-       virtual void OnContentScanCompleted(RequestId reqId, const Tizen::Base::String &scanPath, result r);
+       void OnContentScanCompleted(const Tizen::Base::String &scanPath);\r
 
        void OnContentCreated(void);
        void OnContentUpdated(void);
@@ -120,6 +119,8 @@ private:
        AppControlMediaType __appControlMediaType;
        AppControlSelectionMode __appControlSelectionMode;
        bool __updateProgressStatus;
+       Tizen::Base::String __renameNewPath;\r
+       Tizen::Base::String __renameOrgPath;\r
 };
 
 #endif /* _GL_ALBUM_LIST_PRESENTATION_MODEL_H_ */
index 4fa676c..0f0fd89 100644 (file)
@@ -310,19 +310,21 @@ AlbumListPresentationModel::RenameAlbum(const String& orgPath, const String& new
        else
        {
                __pAlbumListener = pAlbumListener;
-               r = ContentManager::ScanDirectory(newPath, true, this, __reqId);
+               __renameNewPath = newPath;\r
+               __renameOrgPath = orgPath;\r
+               r = ContentManager::ScanDirectory(newPath, true, NULL, __reqId);\r
                AppLogDebug("Content scan failed (%s)", GetErrorMessage(r));
-               r = ContentManager::ScanDirectory(orgPath, true, this, __reqId);
+               r = ContentManager::ScanDirectory(orgPath, true, NULL, __reqId);\r
                AppLogDebug("Content scan failed (%s)", GetErrorMessage(r));
        }
        AppLogDebug("EXIT");
        return r;
 }
 
-void AlbumListPresentationModel::OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r)
+void AlbumListPresentationModel::OnContentScanCompleted (const Tizen::Base::String &scanPath)\r
 {
-       AppLogDebug("ENTER");
-       if (__pAlbumListener && __reqId == reqId)
+       AppLogDebug("ENTER");\r
+       if (__pAlbumListener && ( scanPath == __renameNewPath))\r
        {
                InitializeAlbumInfoList(CONTENT_TYPE_ALL);
                __pAlbumListener->OnAlbumRenameComplete();
index ee27704..c84095c 100644 (file)
@@ -151,6 +151,7 @@ ContentUpdateEventListener::OnContentDirectoryScanCompleted(const Tizen::Base::S
        {
                AlbumListPresentationModel::GetInstance()->OnContentDeleted();
                FileListPresentationModel::GetInstance()->OnContentDeleted();
+               AlbumListPresentationModel::GetInstance()->OnContentScanCompleted( directoryPath );\r
        }
        else
        {
index a3a81d7..36d54ec 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <FUi.h>
 #include "GlAlbumListPresentationModel.h"
+#include "GlContentUpdateEventListener.h"\r
 #include "GlFileListPresentationModel.h"
 #include "GlGalleryApp.h"
 #include "GlMainFrame.h"
@@ -127,7 +128,12 @@ GalleryApp::OnAppInitialized(void)
 bool
 GalleryApp::OnAppTerminating(AppRegistry& appRegistry, bool forcedTermination)
 {
-       AppLogDebug("ENTER");
+       AppLogDebug("ENTER");\r
+       ContentUpdateEventListener* pContentListener = ContentUpdateEventListener::GetInstance();\r
+       if (pContentListener)\r
+       {\r
+               pContentListener->RemoveContentListener();\r
+       }\r
        AlbumListPresentationModel* pAlbumListPresentationModel = AlbumListPresentationModel::GetInstance();
        if (pAlbumListPresentationModel != null)
        {