summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNilesh <t.shripati@samsung.com>2018-12-21 11:53:16 +0530
committerNilesh <t.shripati@samsung.com>2018-12-21 11:53:16 +0530
commitacb4a5d41cc2adf3432e188936281f2fbdbac8c6 (patch)
treed3b7f8584ae23942cf99c94ce1a4b287aa2b2fd7
parent0edf5d67758ead21245f4d72fdcf795811705d64 (diff)
downloadgallery-tizen_5.5.tar.gz
gallery-tizen_5.5.tar.bz2
gallery-tizen_5.5.zip
This patch remove media content deprecated API, media_info_delete_from_db(). Change-Id: I755dc3673b506e5b23eb660e1826886c11d2eef8
-rw-r--r--gallery/model/MediaItem.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/gallery/model/MediaItem.cpp b/gallery/model/MediaItem.cpp
index fd21ffc..2ad27c7 100644
--- a/gallery/model/MediaItem.cpp
+++ b/gallery/model/MediaItem.cpp
@@ -383,12 +383,6 @@ namespace gallery {
{
MutexLock lock(getMediaMutex());
-
- const int ret = media_info_delete_from_db(m_mediaId.c_str());
- if (ret != 0) {
- LOG_RETURN(RES_FAIL, "media_info_delete_from_db() failed: %d", ret);
- }
-
m_media = nullptr;
m_isValid = false;
}
@@ -403,7 +397,22 @@ namespace gallery {
}
return RES_FATAL;
}
-
+ if (m_mediaId.c_str() != NULL) {
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ MutexLock lock(getMediaMutex());
+ ret = media_content_connect();
+ if (ret == MEDIA_CONTENT_ERROR_NONE) {
+ ret = media_content_scan_file(m_filePath.c_str());
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_content_disconnect();
+ LOG_RETURN(RES_FAIL, "media_content_scan_file() failed: %d", ret);
+ }
+ media_content_disconnect();
+ }
+ else {
+ LOG_RETURN(RES_FAIL, "media_content_connect() failed : %d", ret);
+ }
+ }
return RES_OK;
}