static ContentUpdateEventListener* GetInstance(void);
void AddContentListener(void);
void RemoveContentListener(void);
+ bool GetChangeNotificationStatus();
+ void ResumeOperation();
private:
ContentUpdateEventListener(void);
private:
static ContentUpdateEventListener* __pContentUpdateEventListener;
Tizen::Content::ContentManager* __pContentManager;
+ bool __changeNotificationReceived;
};
#endif /* _GL_CONTENT_UPDATE_EVENT_LISTENER_H_ */
* @brief This is the implementation file for ContentUpdateEventListener class.
*/
+#include <FApp.h>
+#include <FUi.h>
#include "GlContentUpdateEventListener.h"
#include "GlFileListPresentationModel.h"
#include "GlAlbumListPresentationModel.h"
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
+bool
+ContentUpdateEventListener::GetChangeNotificationStatus()
+{
+ AppLogDebug("ENTER");
+ AppLogDebug("EXIT");
+ return __changeNotificationReceived;
+}
+
+void
+ContentUpdateEventListener::ResumeOperation()
+{
+ AppLogDebug("ENTER");
+ AlbumListPresentationModel::GetInstance()->OnContentDeleted();
+ FileListPresentationModel::GetInstance()->OnContentDeleted();
+ __changeNotificationReceived = false;
+ AppLogDebug("EXIT");
+}
+
void
ContentUpdateEventListener::OnContentFileCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r)
{
if ( contentType == CONTENT_TYPE_IMAGE || contentType == CONTENT_TYPE_VIDEO)
{
- AlbumListPresentationModel::GetInstance()->OnContentDeleted();
- FileListPresentationModel::GetInstance()->OnContentDeleted();
- }
+ Tizen::App::UiApp* appPtr = Tizen::App::UiApp::GetInstance();
+ if (appPtr->GetAppUiState() == Tizen::App::APP_UI_STATE_FOREGROUND)
+ {
+ AlbumListPresentationModel::GetInstance()->OnContentDeleted();
+ FileListPresentationModel::GetInstance()->OnContentDeleted();
+ }
+ else
+ {
+ __changeNotificationReceived = true;
+ }
+ }
AppLogDebug("EXIT");
}
{
AppLogDebug("ENTER");
- AlbumListPresentationModel::GetInstance()->OnContentDeleted();
- FileListPresentationModel::GetInstance()->OnContentDeleted();
- AlbumListPresentationModel::GetInstance()->OnContentScanCompleted( directoryPath );\r
+ Tizen::App::UiApp* appPtr = Tizen::App::UiApp::GetInstance();
+ if (appPtr->GetAppUiState() == Tizen::App::APP_UI_STATE_FOREGROUND)
+ {
+ AlbumListPresentationModel::GetInstance()->OnContentDeleted();
+ FileListPresentationModel::GetInstance()->OnContentDeleted();
+ AlbumListPresentationModel::GetInstance()->OnContentScanCompleted( directoryPath );
+ }
+ else
+ {
+ __changeNotificationReceived = true;
+ }\r
AppLogDebug("EXIT");
}
pMainFrame->Invalidate(true);
}
+ ContentUpdateEventListener* pContentListener = ContentUpdateEventListener::GetInstance();
+ if (pContentListener->GetChangeNotificationStatus() == true)
+ {
+ pContentListener->ResumeOperation();
+ }
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}