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());
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());
if (const auto listener = m_imageGrid.m_listener.lock()) {
listener->onItemRealized(itemIndex);
}
+
+ makeWhite(m_btn);
+ } else {
+ makeTransparent(m_btn);
}
}
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)