From 181fe5df72b6f8b8653386c3ecb4a82c392dcb81 Mon Sep 17 00:00:00 2001 From: Igor Nazarov Date: Tue, 8 Aug 2017 14:11:33 +0300 Subject: [PATCH] Fix of TizenRefApp-9046 [Gallery] Impossible to delete images - Fixed issue when images sent via USB not removed; - Fixed GUi issue with display of extra images. Change-Id: I951615415e032762c82ae539e9eee2f7db045d77 --- gallery/model/MediaItem.cpp | 9 ++------- gallery/view/ImageGrid.cpp | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/gallery/model/MediaItem.cpp b/gallery/model/MediaItem.cpp index 6b7ba91..aec6b5d 100644 --- a/gallery/model/MediaItem.cpp +++ b/gallery/model/MediaItem.cpp @@ -379,12 +379,6 @@ namespace gallery { LOG_RETURN(RES_NOT_SUPPORTED, "Operation not supported!"); } - const bool exists = ecore_file_exists(m_filePath.c_str()); - - if (exists && !ecore_file_can_write(m_filePath.c_str())) { - LOG_RETURN(RES_FAIL, "File can't be removed!"); - } - { MutexLock lock(getMediaMutex()); @@ -397,7 +391,8 @@ namespace gallery { m_isValid = false; } - if (exists && !ecore_file_remove(m_filePath.c_str())) { + if (ecore_file_exists(m_filePath.c_str()) && + !ecore_file_remove(m_filePath.c_str())) { FLOG("ecore_file_remove() failed! Attempting to rescan...."); MutexLock lock(getMediaMutex()); const int ret = media_content_scan_file(m_filePath.c_str()); diff --git a/gallery/view/ImageGrid.cpp b/gallery/view/ImageGrid.cpp index ef28f5f..942ff97 100644 --- a/gallery/view/ImageGrid.cpp +++ b/gallery/view/ImageGrid.cpp @@ -333,6 +333,10 @@ namespace gallery { if (const auto listener = m_imageGrid.m_listener.lock()) { listener->onItemRealized(itemIndex); } + + makeWhite(m_btn); + } else { + makeTransparent(m_btn); } } @@ -534,29 +538,26 @@ namespace gallery { void onClicked(Widget &widget, void *eventInfo) { - if (!isRealized()) { - LOG_RETURN_VOID(RES_ILLEGAL_STATE, "Item is not realized!"); + if (isRealized()) { + m_imageGrid.handleItemEvent(m_realizeIndex, + ItemEvent::CLICK, -1, -1); } - m_imageGrid.handleItemEvent(m_realizeIndex, - ItemEvent::CLICK, -1, -1); } void onDoubleTap(const int x, const int y) { - if (!isRealized()) { - LOG_RETURN_VOID(RES_ILLEGAL_STATE, "Item is not realized!"); + if (isRealized()) { + m_imageGrid.handleItemEvent(m_realizeIndex, + ItemEvent::DOUBLE_TAP, x, y); } - m_imageGrid.handleItemEvent(m_realizeIndex, - ItemEvent::DOUBLE_TAP, x, y); } void onTapAndHold(const int x, const int y) { - if (!isRealized()) { - LOG_RETURN_VOID(RES_ILLEGAL_STATE, "Item is not realized!"); + if (isRealized()) { + m_imageGrid.handleItemEvent(m_realizeIndex, + ItemEvent::TAP_AND_HOLD, x, y); } - m_imageGrid.handleItemEvent(m_realizeIndex, - ItemEvent::TAP_AND_HOLD, x, y); } void onHighlighted(Widget &widget, void *eventInfo) -- 2.34.1