gboolean do_cancel = FALSE;
if (cancel) {
g_mutex_lock(&cancel->s_mutex);
- if (cancel->do_cancel)
+ if (cancel->do_cancel) {
do_cancel = TRUE;
+ }
g_mutex_unlock(&cancel->s_mutex);
}
return do_cancel;
gboolean is_cancelled = FALSE;
if (cancel) {
g_mutex_lock(&cancel->s_mutex);
- if (cancel->is_cancel)
+ if (cancel->is_cancel) {
is_cancelled = TRUE;
+ }
g_mutex_unlock(&cancel->s_mutex);
}
return is_cancelled;
#ifndef SAFE_FREE
#define SAFE_FREE(x) do {\
- if ((x) != NULL) {\
- free(x); x = NULL;\
- } \
- } while (0)
+ if ((x) != NULL) {\
+ free(x); x = NULL;\
+ } \
+ } while (0)
#endif
#define MSG_REPORT_PERIOD (1)
GString *n = NULL;
if ((strstr(name, old_root) == NULL)
- || (name_len <= old_len)
- || ((name[old_len] == '/' && name[old_len + 1] == '\0'))
- || FALSE) {
+ || (name_len <= old_len)
+ || ((name[old_len] == '/' && name[old_len + 1] == '\0'))
+ || FALSE) {
mf_fo_loge("invaild args - name : [%s], old_root : [%s]", name, old_root);
return NULL;
}
int _mf_copy_copy_regfile(const char *src, struct stat *src_statp, const char *dst_file, unsigned long buf_size, mf_cancel *cancel, _mf_fo_msg_cb msg_cb,
- void *msg_data)
+ void *msg_data)
{
mf_retvm_if(msg_cb == NULL, 0, "msg_cb is NULL");
FO_TRACE_BEGIN;
}
}
//Prevent issue fix
-/*
- if (dst_info.st_blksize > 0) {
- alloc_size = dst_info.st_blksize;
- }
- } else {
- alloc_size = buf_size;
- }*/
+ /*
+ if (dst_info.st_blksize > 0) {
+ alloc_size = dst_info.st_blksize;
+ }
+ } else {
+ alloc_size = buf_size;
+ }*/
alloc_size = DEF_ALLLOC_SIZE;
buf = malloc(alloc_size);
if (cp_handle->msg.total_size > PER_HANDLE_MAX_SIZE) {
dynamic_size = 64;
} else if (cp_handle->msg.total_size <= PER_HANDLE_MAX_SIZE &&
- cp_handle->msg.total_size > PER_HANDLE_MIN_SIZE) {
+ cp_handle->msg.total_size > PER_HANDLE_MIN_SIZE) {
dynamic_size = 8;
} else {
dynamic_size = 1;
mf_error(">>>>>>>>>>>>>>>>>>>remain_size = %lld", remain_size);
mf_error(">>>>>>>>>>>>>>>>>>>src_info.st_size = %lld",
- (long long)src_info.st_size);
+ (long long)src_info.st_size);
if (remain_size == 0 || remain_size < src_info.st_size) {
err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_SPACE);
msg_cb(MF_MSG_ERROR, cp_handle->dst_dir, 0, err, msg_data);
}
int sync_value = 0;
ssize_t sync_msg_size = 0;
- while ((r_size = fread(buf, 1, alloc_size, src_f)) > 0)
- {
+ while ((r_size = fread(buf, 1, alloc_size, src_f)) > 0) {
ssize_t total = r_size;
void *buf_p = buf;
sync_value++;
{
mf_fo_dir_list_info *info = NULL;
mf_debug("pathname is [%s]\t type is [%d]\t",
- pathname, type);
+ pathname, type);
switch (type) {
}
case FTW_D:
info = calloc(sizeof(mf_fo_dir_list_info), 1);
- if (info !=NULL) {
+ if (info != NULL) {
info->ftw_path = g_strdup(pathname);
info->type = type;
copy_list = g_slist_append(copy_list, info);
switch (result) {
case MF_REQ_NONE:
- case MF_REQ_MERGE:
- {
- struct stat dst_info;
- if (stat(new_dst, &dst_info)) {
- MF_FILE_ERROR_LOG(err_buf, "Fail to stat new_dst ", new_dst);
+ case MF_REQ_MERGE: {
+ struct stat dst_info;
+ if (stat(new_dst, &dst_info)) {
+ MF_FILE_ERROR_LOG(err_buf, "Fail to stat new_dst ", new_dst);
+ if (msg_func) {
+ msg_func(MF_MSG_ERROR, NULL, 0, errno, msg_data);
+ }
+ goto ERROR_FREE_MEM;
+ }
+
+ if (S_ISDIR(src_info.st_mode)) {
+ if (!S_ISDIR(dst_info.st_mode)) {
+ mf_fo_loge("src[%s] is directory, but dst[%s] is already existed and not a directory", src, new_dst);
+
+ err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
if (msg_func) {
- msg_func(MF_MSG_ERROR, NULL, 0, errno, msg_data);
+ msg_func(MF_MSG_ERROR, new_dst, 0, err, msg_data);
}
goto ERROR_FREE_MEM;
}
+ /*just copy*/
+ err = _mf_copy_copy_directory(src, &src_info, new_dst, cancel, msg_func, msg_data);
+ if (err == 0) {
+ //mf_media_content_scan_folder(new_dst);
+ }
+ } else if (S_ISREG(src_info.st_mode)) {
+ if (!S_ISREG(dst_info.st_mode)) {
+ mf_fo_loge("src[%s] is file, but dst[%s] is already existed and not a file", src, new_dst);
+ err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
+ if (msg_func) {
+ msg_func(MF_MSG_ERROR, new_dst, 0, err, msg_data);
+ }
+ goto ERROR_FREE_MEM;
+ }
+ /*just copy*/
+ err = _mf_copy_copy_regfile(src, &src_info, new_dst, dst_info.st_blksize, cancel, msg_func, msg_data);
+ if (err == 0) {
+ //mf_media_content_scan_file(new_dst);
+ }
+ }
+ }
+ break;
+ case MF_REQ_RENAME: {
+ if (next_name) {
if (S_ISDIR(src_info.st_mode)) {
- if (!S_ISDIR(dst_info.st_mode)) {
- mf_fo_loge("src[%s] is directory, but dst[%s] is already existed and not a directory", src, new_dst);
-
- err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
+ err = _mf_copy_copy_directory(src, &src_info, next_name, cancel, msg_func, msg_data);
+ if (err == 0) {
+ //mf_media_content_scan_folder(next_name);
+ }
+ } else if (S_ISREG(src_info.st_mode)) {
+ err = _mf_copy_copy_regfile(src, &src_info, next_name, 0, cancel, msg_func, msg_data);
+ if (err == 0) {
+ //mf_media_content_scan_file(next_name);
+ }
+ }
+ SAFE_FREE(next_name);
+ } else {
+ if (S_ISDIR(src_info.st_mode)) {
+ int errcode = 0;
+ next_name = _mf_fo_get_next_unique_dirname(new_dst, &errcode);
+ if (!next_name) {
+ mf_fo_loge("Fail to get next directory name [%s]", new_dst);
+ err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
if (msg_func) {
- msg_func(MF_MSG_ERROR, new_dst, 0, err, msg_data);
+ msg_func(MF_MSG_ERROR, NULL, 0, err, msg_data);
}
goto ERROR_FREE_MEM;
}
- /*just copy*/
- err = _mf_copy_copy_directory(src, &src_info, new_dst, cancel, msg_func, msg_data);
+ err = _mf_copy_copy_directory(src, &src_info, next_name, cancel, msg_func, msg_data);
if (err == 0) {
- //mf_media_content_scan_folder(new_dst);
+ //mf_media_content_scan_folder(next_name);
}
} else if (S_ISREG(src_info.st_mode)) {
- if (!S_ISREG(dst_info.st_mode)) {
- mf_fo_loge("src[%s] is file, but dst[%s] is already existed and not a file", src, new_dst);
- err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
+ int errcode = 0;
+ next_name = _mf_fo_get_next_unique_filename(new_dst, &errcode);
+ if (!next_name) {
+ mf_fo_loge("Fail to get next file name [%s]", new_dst);
+ err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
if (msg_func) {
- msg_func(MF_MSG_ERROR, new_dst, 0, err, msg_data);
+ msg_func(MF_MSG_ERROR, NULL, 0, err, msg_data);
}
goto ERROR_FREE_MEM;
}
- /*just copy*/
- err = _mf_copy_copy_regfile(src, &src_info, new_dst, dst_info.st_blksize, cancel, msg_func, msg_data);
+ err = _mf_copy_copy_regfile(src, &src_info, next_name, 0, cancel, msg_func, msg_data);
if (err == 0) {
- //mf_media_content_scan_file(new_dst);
+ //mf_media_content_scan_file(next_name);
}
}
-
+ SAFE_FREE(next_name);
}
- break;
- case MF_REQ_RENAME:
- {
- if (next_name) {
- if (S_ISDIR(src_info.st_mode)) {
- err = _mf_copy_copy_directory(src, &src_info, next_name, cancel, msg_func, msg_data);
- if (err == 0) {
- //mf_media_content_scan_folder(next_name);
- }
- } else if (S_ISREG(src_info.st_mode)) {
- err = _mf_copy_copy_regfile(src, &src_info, next_name, 0, cancel, msg_func, msg_data);
- if (err == 0) {
- //mf_media_content_scan_file(next_name);
- }
- }
- SAFE_FREE(next_name);
- } else {
- if (S_ISDIR(src_info.st_mode)) {
- int errcode = 0;
- next_name = _mf_fo_get_next_unique_dirname(new_dst, &errcode);
- if (!next_name) {
- mf_fo_loge("Fail to get next directory name [%s]", new_dst);
- err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
- if (msg_func) {
- msg_func(MF_MSG_ERROR, NULL, 0, err, msg_data);
- }
- goto ERROR_FREE_MEM;
- }
- err = _mf_copy_copy_directory(src, &src_info, next_name, cancel, msg_func, msg_data);
- if (err == 0) {
- //mf_media_content_scan_folder(next_name);
- }
- } else if (S_ISREG(src_info.st_mode)) {
- int errcode = 0;
- next_name = _mf_fo_get_next_unique_filename(new_dst, &errcode);
- if (!next_name) {
- mf_fo_loge("Fail to get next file name [%s]", new_dst);
- err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
- if (msg_func) {
- msg_func(MF_MSG_ERROR, NULL, 0, err, msg_data);
- }
- goto ERROR_FREE_MEM;
- }
- err = _mf_copy_copy_regfile(src, &src_info, next_name, 0, cancel, msg_func, msg_data);
- if (err == 0) {
- //mf_media_content_scan_file(next_name);
- }
- }
- SAFE_FREE(next_name);
- }
- }
- break;
- case MF_REQ_SKIP:
- {
- if (msg_func) {
- unsigned long long size = 0;
- /*1 TODO : Do i need to report error, if i fail to get size ?*/
- _mf_fo_get_total_item_size(src, &size);
- msg_func(MF_MSG_SKIP, NULL, size, 0, msg_data);
- }
+ }
+ break;
+ case MF_REQ_SKIP: {
+ if (msg_func) {
+ unsigned long long size = 0;
+ /*1 TODO : Do i need to report error, if i fail to get size ?*/
+ _mf_fo_get_total_item_size(src, &size);
+ msg_func(MF_MSG_SKIP, NULL, size, 0, msg_data);
}
- break;
- case MF_REQ_CANCEL:
- {
- if (cancel) {
- mf_cancel_do_cancel(cancel);
- }
- goto CANCEL_FREE_MEM;
+ }
+ break;
+ case MF_REQ_CANCEL: {
+ if (cancel) {
+ mf_cancel_do_cancel(cancel);
}
- break;
+ goto CANCEL_FREE_MEM;
+ }
+ break;
default:
abort();
break;
g_mutex_lock(&cp_handle->lock);
if (ap->mf_Status.check == 1) {
gint64 end_time;
- end_time = g_get_monotonic_time () + 5 * G_TIME_SPAN_SECOND;
+ end_time = g_get_monotonic_time() + 5 * G_TIME_SPAN_SECOND;
while (mf_request_flag_get(req)) {
if (!g_cond_wait_until(&cp_handle->cond, &cp_handle->lock, end_time)) {
mf_fo_loge("g_cond_wait_until is timeout, time is %lld", end_time);
mf_fo_loge("Fail to get size of %s", s_path);
__mf_copy_msg_cb(MF_MSG_ERROR, s_path, 0,
- (MF_FO_ERR_SRC_CLASS | _mf_fo_errno_to_mferr(-errcode)), cp_handle);
+ (MF_FO_ERR_SRC_CLASS | _mf_fo_errno_to_mferr(-errcode)), cp_handle);
goto ERROR_END_THREAD;
} else {
cp_handle->msg.current = s_path;
g_mutex_unlock(&cp_handle->lock);
ret = _mf_copy_copy_internal(s_path, cp_handle->dst_dir, cp_handle->cancel,
- __mf_copy_msg_cb, __mf_copy_req_cb, cp_handle);
+ __mf_copy_msg_cb, __mf_copy_req_cb, cp_handle);
if (ret > 0) {
if (cp_handle->cancel) {
}
c_stop = __mf_copy_get_time();
mf_fo_logi("## Total src size - %lld byte, size time : %lf sec, copy time : %lf sec",
- cp_handle->msg.total_size, s_stop - s_start, c_stop - c_start);
+ cp_handle->msg.total_size, s_stop - s_start, c_stop - c_start);
if (cancelled) {
__mf_copy_msg_cb(MF_MSG_CANCELLED, NULL, 0, 0, cp_handle);
}
g_mutex_lock(&cp_handle->lock);
int media_content_ret = media_content_scan_folder(cp_handle->dst_dir, true, __mf_media_scan_folder_completed_cb, cp_handle);
- if(media_content_ret !=MEDIA_CONTENT_ERROR_NONE) {
+ if (media_content_ret != MEDIA_CONTENT_ERROR_NONE) {
mf_error("media_content_scan_folder() is failed, media_content_ret = [%d]", media_content_ret);
g_mutex_unlock(&cp_handle->lock);
} else {
#ifndef SAFE_FREE
#define SAFE_FREE(x) do {\
- if ((x) != NULL) {\
- free(x); \
- x = NULL;\
- } \
- } while (0)
+ if ((x) != NULL) {\
+ free(x); \
+ x = NULL;\
+ } \
+ } while (0)
#endif
int _mf_delete_delete_regfile(const char *file, struct stat *file_statp, mf_cancel *cancel, _mf_fo_msg_cb msg_cb, void *msg_data)
{
mf_fo_dir_list_info *info = NULL;
mf_debug("pathname is [%s]\t type is [%d]\t",
- pathname, type);
+ pathname, type);
switch (type) {
}
c_stop = get_time();
mf_fo_logi("## Total src size - %lld byte, size time : %lf sec, delete time : %lf sec",
- handle->msg.total_size, s_stop - s_start, c_stop - c_start);
+ handle->msg.total_size, s_stop - s_start, c_stop - c_start);
if (cancelled) {
/*cancel message*/
GSList *dir_list = NULL;
#ifndef SAFE_FREE
#define SAFE_FREE(x) do { \
- if ((x) != NULL) {\
- free(x); \
- x = NULL;\
- } \
- } while (0)
+ if ((x) != NULL) {\
+ free(x); \
+ x = NULL;\
+ } \
+ } while (0)
#endif
#ifndef NAME_MAX
{
mf_fo_dir_list_info *info = NULL;
mf_debug("pathname is [%s]\t type is [%d]\t size is [%ld]",
- pathname, type, statptr->st_size);
+ pathname, type, statptr->st_size);
switch (type) {
}
new_name = malloc(sizeof(char) * p_max);
-
+
if (new_name) {
int next_num = 0;
long n_max = 0;
- memset(new_name, 0, sizeof(char) * p_max);
+ memset(new_name, 0, sizeof(char) * p_max);
n_max = __mf_fo_get_name_max();
do {
void _mf_fo_free_directory_hierarchies(GSList **glist)
{
- if (*glist == NULL)
+ if (*glist == NULL) {
return;
+ }
GSList *list = *glist;
while (list) {
mf_fo_dir_list_info *info = NULL;
#ifndef SAFE_FREE
#define SAFE_FREE(x) do {\
- if ((x) != NULL) {\
- free(x); \
- x = NULL;\
- } \
- } while (0)
+ if ((x) != NULL) {\
+ free(x); \
+ x = NULL;\
+ } \
+ } while (0)
#endif
#define DIR_MODE_BIT (01777)
GString *n = NULL;
if ((strstr(name, old_root) == NULL)
- || (name_len <= old_len)
- || ((name[old_len] == '/' && name[old_len + 1] == '\0'))
- || FALSE) {
+ || (name_len <= old_len)
+ || ((name[old_len] == '/' && name[old_len + 1] == '\0'))
+ || FALSE) {
mf_fo_loge("invaild args - name : [%s], old_root : [%s]", name, old_root);
return NULL;
}
int _mf_move_move_regfile(const char *src, struct stat *src_statp, const char *dst,
- unsigned long buf_size, mf_cancel *cancel, _mf_fo_msg_cb msg_cb, void *msg_data)
+ unsigned long buf_size, mf_cancel *cancel, _mf_fo_msg_cb msg_cb, void *msg_data)
{
mode_t src_mode = 0;
dev_t src_dev = 0;
MF_TRACE_BEGIN;
mf_fo_dir_list_info *info = NULL;
mf_debug("pathname is [%s]\t type is [%d]\t",
- pathname, type);
+ pathname, type);
switch (type) {
case FTW_F:
}
int _mf_move_move_internal(const char *src, const char *dst_dir,
- mf_cancel *cancel, mf_req_callback request_callback, _mf_fo_msg_cb msg_callback, void *msg_data)
+ mf_cancel *cancel, mf_req_callback request_callback, _mf_fo_msg_cb msg_callback, void *msg_data)
{
char *src_basename = NULL;
char *new_dst = NULL;
switch (result) {
case MF_REQ_NONE:
- case MF_REQ_MERGE:
- {
- struct stat dst_info;
- if (stat(new_dst, &dst_info)) {
- MF_FILE_ERROR_LOG(err_buf, "Fail to stat new_dst", new_dst);
+ case MF_REQ_MERGE: {
+ struct stat dst_info;
+ if (stat(new_dst, &dst_info)) {
+ MF_FILE_ERROR_LOG(err_buf, "Fail to stat new_dst", new_dst);
+ if (msg_callback) {
+ msg_callback(MF_MSG_ERROR, NULL, 0, errno, msg_data);
+ }
+ goto ERROR_FREE_MEM;
+ }
+
+ if (S_ISDIR(src_info.st_mode)) {
+ if (!S_ISDIR(dst_info.st_mode)) {
+ mf_fo_loge("src[%s] is directory, but dst[%s] is already existed and not a directory", src, new_dst);
+
+ err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
+ if (msg_callback) {
+ msg_callback(MF_MSG_ERROR, new_dst, 0, err, msg_data);
+ }
+ goto ERROR_FREE_MEM;
+ }
+ err = _mf_move_move_directory(src, &src_info, new_dst, cancel, msg_callback, msg_data);
+ if (err == 0) {
+ err = _mf_delete_delete_directory(src, cancel, NULL, NULL);
+ if (err > 0) {
+ goto CANCEL_FREE_MEM;
+ } else if (err < 0) {
+ if (msg_callback) {
+ msg_callback(MF_MSG_ERROR, NULL, 0, err, msg_data);
+ }
+ goto ERROR_FREE_MEM;
+ }
+ mf_media_content_scan_folder(new_dst);
+ }
+ } else if (S_ISREG(src_info.st_mode)) {
+ if (!S_ISREG(dst_info.st_mode)) {
+ mf_fo_loge("src[%s] is file, but dst[%s] is already existed and not a file", src, new_dst);
+ err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
if (msg_callback) {
- msg_callback(MF_MSG_ERROR, NULL, 0, errno, msg_data);
+ msg_callback(MF_MSG_ERROR, new_dst, 0, err, msg_data);
}
goto ERROR_FREE_MEM;
}
+ err = _mf_move_move_regfile(src, &src_info, new_dst, dst_info.st_blksize, cancel, msg_callback, msg_data);
+ if (err == 0) {
+ mf_media_content_scan_file(new_dst);
+ }
+ }
+ }
+ break;
+ case MF_REQ_RENAME: {
+ if (next_name) {
if (S_ISDIR(src_info.st_mode)) {
- if (!S_ISDIR(dst_info.st_mode)) {
- mf_fo_loge("src[%s] is directory, but dst[%s] is already existed and not a directory", src, new_dst);
-
- err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
+ err = _mf_move_move_directory(src, &src_info, next_name, cancel, msg_callback, msg_data);
+ if (err == 0) {
+ mf_media_content_scan_folder(next_name);
+ }
+ } else if (S_ISREG(src_info.st_mode)) {
+ err = _mf_move_move_regfile(src, &src_info, next_name, 0, cancel, msg_callback, msg_data);
+ if (err == 0) {
+ mf_media_content_scan_file(next_name);
+ }
+ }
+ SAFE_FREE(next_name);
+ } else {
+ if (S_ISDIR(src_info.st_mode)) {
+ int errcode = 0;
+ next_name = _mf_fo_get_next_unique_dirname(new_dst, &errcode);
+ if (!next_name) {
+ mf_fo_loge("Fail to get next directory name [%s]", new_dst);
+ err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
if (msg_callback) {
- msg_callback(MF_MSG_ERROR, new_dst, 0, err, msg_data);
+ msg_callback(MF_MSG_ERROR, NULL, 0, err, msg_data);
}
goto ERROR_FREE_MEM;
}
- err = _mf_move_move_directory(src, &src_info, new_dst, cancel, msg_callback, msg_data);
+ err = _mf_move_move_directory(src, &src_info, next_name, cancel, msg_callback, msg_data);
if (err == 0) {
err = _mf_delete_delete_directory(src, cancel, NULL, NULL);
if (err > 0) {
}
goto ERROR_FREE_MEM;
}
- mf_media_content_scan_folder(new_dst);
+ mf_media_content_scan_folder(next_name);
}
} else if (S_ISREG(src_info.st_mode)) {
- if (!S_ISREG(dst_info.st_mode)) {
- mf_fo_loge("src[%s] is file, but dst[%s] is already existed and not a file", src, new_dst);
- err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_TYPE);
+ int errcode = 0;
+ next_name = _mf_fo_get_next_unique_filename(new_dst, &errcode);
+ if (!next_name) {
+ mf_fo_loge("Fail to get next file name [%s]", new_dst);
+ err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
if (msg_callback) {
- msg_callback(MF_MSG_ERROR, new_dst, 0, err, msg_data);
+ msg_callback(MF_MSG_ERROR, NULL, 0, err, msg_data);
}
goto ERROR_FREE_MEM;
}
- err = _mf_move_move_regfile(src, &src_info, new_dst, dst_info.st_blksize, cancel, msg_callback, msg_data);
+ err = _mf_move_move_regfile(src, &src_info, next_name, 0, cancel, msg_callback, msg_data);
if (err == 0) {
- mf_media_content_scan_file(new_dst);
- }
- }
-
- }
- break;
- case MF_REQ_RENAME:
- {
- if (next_name) {
- if (S_ISDIR(src_info.st_mode)) {
- err = _mf_move_move_directory(src, &src_info, next_name, cancel, msg_callback, msg_data);
- if (err == 0) {
- mf_media_content_scan_folder(next_name);
- }
- } else if (S_ISREG(src_info.st_mode)) {
- err = _mf_move_move_regfile(src, &src_info, next_name, 0, cancel, msg_callback, msg_data);
- if (err == 0) {
- mf_media_content_scan_file(next_name);
- }
- }
- SAFE_FREE(next_name);
- } else {
- if (S_ISDIR(src_info.st_mode)) {
- int errcode = 0;
- next_name = _mf_fo_get_next_unique_dirname(new_dst, &errcode);
- if (!next_name) {
- mf_fo_loge("Fail to get next directory name [%s]", new_dst);
- err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
- if (msg_callback) {
- msg_callback(MF_MSG_ERROR, NULL, 0, err, msg_data);
- }
- goto ERROR_FREE_MEM;
- }
- err = _mf_move_move_directory(src, &src_info, next_name, cancel, msg_callback, msg_data);
- if (err == 0) {
- err = _mf_delete_delete_directory(src, cancel, NULL, NULL);
- if (err > 0) {
- goto CANCEL_FREE_MEM;
- } else if (err < 0) {
- if (msg_callback) {
- msg_callback(MF_MSG_ERROR, NULL, 0, err, msg_data);
- }
- goto ERROR_FREE_MEM;
- }
- mf_media_content_scan_folder(next_name);
- }
- } else if (S_ISREG(src_info.st_mode)) {
- int errcode = 0;
- next_name = _mf_fo_get_next_unique_filename(new_dst, &errcode);
- if (!next_name) {
- mf_fo_loge("Fail to get next file name [%s]", new_dst);
- err = (_mf_fo_errno_to_mferr(errcode) | MF_FO_ERR_DST_CLASS);
- if (msg_callback) {
- msg_callback(MF_MSG_ERROR, NULL, 0, err, msg_data);
- }
- goto ERROR_FREE_MEM;
- }
- err = _mf_move_move_regfile(src, &src_info, next_name, 0, cancel, msg_callback, msg_data);
- if (err == 0) {
- mf_media_content_scan_file(next_name);
- }
+ mf_media_content_scan_file(next_name);
}
- SAFE_FREE(next_name);
}
+ SAFE_FREE(next_name);
}
- break;
- case MF_REQ_SKIP:
- {
- if (msg_callback) {
- unsigned long long size = 0;
- _mf_fo_get_total_item_size(src, &size);
- msg_callback(MF_MSG_SKIP, NULL, size, 0, msg_data);
- }
+ }
+ break;
+ case MF_REQ_SKIP: {
+ if (msg_callback) {
+ unsigned long long size = 0;
+ _mf_fo_get_total_item_size(src, &size);
+ msg_callback(MF_MSG_SKIP, NULL, size, 0, msg_data);
}
- break;
- case MF_REQ_CANCEL:
- {
- if (cancel) {
- mf_cancel_do_cancel(cancel);
- }
- goto CANCEL_FREE_MEM;
+ }
+ break;
+ case MF_REQ_CANCEL: {
+ if (cancel) {
+ mf_cancel_do_cancel(cancel);
}
- break;
+ goto CANCEL_FREE_MEM;
+ }
+ break;
default:
abort();
break;
mf_fo_loge("Fail to get size of %s", s_path);
__mf_move_msg_cb(MF_MSG_ERROR, s_path, 0,
- (MF_FO_ERR_SRC_CLASS | _mf_fo_errno_to_mferr(-errcode)), handle);
+ (MF_FO_ERR_SRC_CLASS | _mf_fo_errno_to_mferr(-errcode)), handle);
goto ERROR_END_THREAD;
if (stat(s_path, &src_info)) {
__mf_move_msg_cb(MF_MSG_ERROR, handle->dst_dir, 0,
- (MF_FO_ERR_DST_CLASS | _mf_fo_errno_to_mferr(errno)), handle);
+ (MF_FO_ERR_DST_CLASS | _mf_fo_errno_to_mferr(errno)), handle);
goto ERROR_END_THREAD;
}
n_size -= size;
} else {
mf_fo_loge("remain size [%lld], needed size [%lld], current item size [%lld] -[%s]",
- r_size, n_size, size, s_path);
+ r_size, n_size, size, s_path);
int err = MF_FO_ERR_SET(MF_FO_ERR_DST_CLASS | MF_FO_ERR_SPACE);
}
c_stop = __mf_move_get_time();
mf_fo_logi("## Total src size - %lld byte, size time : %lf sec, move time : %lf sec",
- handle->msg.total_size, s_stop - s_start, c_stop - c_start);
+ handle->msg.total_size, s_stop - s_start, c_stop - c_start);
if (cancelled) {
__mf_move_msg_cb(MF_MSG_CANCELLED, NULL, 0, 0, handle);
args->root_path = NULL;
}
- if (args->needle)
+ if (args->needle) {
g_free(args->needle);
+ }
g_free(args);
}
#ifdef CHECK_RESTRICTED_PATH
gboolean __mf_search_check_licet_path(const char *path)
{
- return (gboolean) (strstr(path, ROOT_UMS) || strstr(path, ROOT_MMC));
+ return (gboolean)(strstr(path, ROOT_UMS) || strstr(path, ROOT_MMC));
}
#endif /*CHECK_RESTRICTED_PATH*/
- /*This function is for testing and should be revised for performance before applying*/
+/*This function is for testing and should be revised for performance before applying*/
static inline gboolean __has_nonspacing_mark(const char *nstr)
{
if (nstr) {
}
}
- if (s_len < n_len)
+ if (s_len < n_len) {
return FALSE;
+ }
if (__has_nonspacing_mark(str)) {
const char *p_str = str;
p_str = g_utf8_next_char(p_str);
}
} else {
- return (gboolean) (!(!strstr(str, needle)));
+ return (gboolean)(!(!strstr(str, needle)));
}
return FALSE;
}
static GList *__mf_search_do_find(const char *root,
- const char *needle,
- mf_search_option option,
- ms_handle_t *handle)
+ const char *needle,
+ mf_search_option option,
+ ms_handle_t *handle)
{
DIR *directory = NULL;
GList *candidate = NULL;
result->is_end = FALSE;
__mf_search_thread_unlock(handle);
- }else {
+ } else {
free(path);
path = NULL;
}
}
/* we are not going to search /opt/media/SLP_Debug folder */
if ((strlen(result->current_dir) == strlen(PHONE_FOLDER)) && (strcmp(result->current_dir, PHONE_FOLDER) == 0)
- && (strlen(entry->d_name) == strlen(DEBUG_FOLDER)) && (strcmp(entry->d_name, DEBUG_FOLDER) == 0)) {
+ && (strlen(entry->d_name) == strlen(DEBUG_FOLDER)) && (strcmp(entry->d_name, DEBUG_FOLDER) == 0)) {
SECURE_DEBUG("[%s] is hidden folder. Skip it", entry->d_name);
continue;
}
if (up_name && needle) {
up_needle = g_utf8_strup(needle, strlen(needle));
gchar *nor_str = g_utf8_strup(up_name, strlen(up_name));
- if (__mf_search_NFD_strstr(nor_str, up_needle))
- {
+ if (__mf_search_NFD_strstr(nor_str, up_needle)) {
__mf_search_thread_lock(handle);
result->dir_list = g_list_append(result->dir_list, (gpointer) g_strdup(path));
result->is_end = FALSE;
}
int _mf_search_start(ms_handle_t *handle,
- const char **root_path,
- unsigned int path_num,
- const char *needle,
- mf_search_option option,
- void *user_data,
- mf_search_filter_cb func,
- int category,
- int item_count)
+ const char **root_path,
+ unsigned int path_num,
+ const char *needle,
+ mf_search_option option,
+ void *user_data,
+ mf_search_filter_cb func,
+ int category,
+ int item_count)
{
ms_args_t *args = NULL;
mf_search_result_t *result = NULL;
}
#endif /*CHECK_RESTRICTED_PATH*/
if (g_file_test(path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)
- && ((l_opt & MF_SEARCH_OPT_HIDDEN) || strncmp(path, ".", 1))
- && TRUE) {
+ && ((l_opt & MF_SEARCH_OPT_HIDDEN) || strncmp(path, ".", 1))
+ && TRUE) {
gchar *new_path = NULL;
gssize len = strlen(path);
if (ms_handle->state == MF_SEARCH_STATE_SEARCH) {
mf_search_stop((mf_search_handle)ms_handle);
}
-/* __mf_search_cmd_lock(ms_handle); */
-/* __mf_search_cmd_unlock(ms_handle); */
+ /* __mf_search_cmd_lock(ms_handle); */
+ /* __mf_search_cmd_unlock(ms_handle); */
g_mutex_clear(&ms_handle->cmd_lock);
}
int mf_search_start(mf_search_handle handle,
- const char **root_path,
- unsigned int path_num,
- const char *needle,
- mf_search_option option,
- void *user_data,
- mf_search_filter_cb func,
- int category,
- int item_count)
+ const char **root_path,
+ unsigned int path_num,
+ const char *needle,
+ mf_search_option option,
+ void *user_data,
+ mf_search_filter_cb func,
+ int category,
+ int item_count)
{
int ret = 0;
if (!handle) {
return MYFILE_ERR_INVALID_FILE_NAME;
}
#endif
-
+
pattern = MYFILE_NAME_PATTERN;
z = regcomp(®, pattern, cflags);
SECURE_DEBUG("Path :::: [%s]", path);
*parent_path = g_strdup(path);
- if (*parent_path == NULL)
+ if (*parent_path == NULL) {
return MYFILE_ERR_ALLOCATE_MEMORY_FAIL;
+ }
const char *name = NULL;
name = mf_file_get(path);
** strlen(parent_path) should large than strlen(name) normally.
** to take exception like input path is "", we add a if condition
*/
- if (strlen(*parent_path) > strlen(name))
+ if (strlen(*parent_path) > strlen(name)) {
(*parent_path)[strlen(*parent_path) - strlen(name) - 1] = '\0';
+ }
if (strlen(*parent_path) == 0) {
free(*parent_path);
case FILE_TYPE_IMAGE:
case FILE_TYPE_VIDEO:
case FILE_TYPE_MUSIC:
- case FILE_TYPE_SOUND:
- {
-
- int err = 0;
- mf_transfer_data_s tmp_data;
- memset(&tmp_data, 0x00, sizeof(mf_transfer_data_s));
- tmp_data.file_path = file_path;
- tmp_data.media = media_info;
- //err = mf_file_attr_get_thumbnail(&tmp_data);
- char *condition = NULL;
- condition = g_strdup_printf("%s and MEDIA_PATH=\"%s\"", MF_CONDITION_IMAGE_VIDEO, tmp_data.file_path);
- err = mf_media_content_data_get(&tmp_data, condition, __mf_local_data_get_media_thumbnail_cb);
- if (err == 0) {
- if (tmp_data.thumb_path && mf_file_exists(tmp_data.thumb_path)) {
- SAFE_FREE_CHAR(icon_path);
- icon_path = g_strdup(tmp_data.thumb_path);
- thumbnail_type = MF_THUMBNAIL_TYPE_THUMBNAIL;
- } else {
- icon_path = g_strdup(mf_file_attr_get_default_icon_by_type(ftype));
- thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
- *error_code = 1;
- }
+ case FILE_TYPE_SOUND: {
+
+ int err = 0;
+ mf_transfer_data_s tmp_data;
+ memset(&tmp_data, 0x00, sizeof(mf_transfer_data_s));
+ tmp_data.file_path = file_path;
+ tmp_data.media = media_info;
+ //err = mf_file_attr_get_thumbnail(&tmp_data);
+ char *condition = NULL;
+ condition = g_strdup_printf("%s and MEDIA_PATH=\"%s\"", MF_CONDITION_IMAGE_VIDEO, tmp_data.file_path);
+ err = mf_media_content_data_get(&tmp_data, condition, __mf_local_data_get_media_thumbnail_cb);
+ if (err == 0) {
+ if (tmp_data.thumb_path && mf_file_exists(tmp_data.thumb_path)) {
+ SAFE_FREE_CHAR(icon_path);
+ icon_path = g_strdup(tmp_data.thumb_path);
+ thumbnail_type = MF_THUMBNAIL_TYPE_THUMBNAIL;
} else {
- if (error_code)
- *error_code = err;
-
icon_path = g_strdup(mf_file_attr_get_default_icon_by_type(ftype));
thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
+ *error_code = 1;
+ }
+ } else {
+ if (error_code) {
+ *error_code = err;
}
- SAFE_FREE_CHAR(tmp_data.thumb_path);
+
+ icon_path = g_strdup(mf_file_attr_get_default_icon_by_type(ftype));
+ thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
}
- break;
+ SAFE_FREE_CHAR(tmp_data.thumb_path);
+ }
+ break;
default:
icon_path = g_strdup(mf_file_attr_get_default_icon_by_type(ftype));
thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
if (!g_strcmp0(parent_name, DEFAULT_FOLDER_IMAGE) && !g_strcmp0(name, SUB_FODER_WALLPAPER)) {
*result = true;
} else if (!g_strcmp0(parent_name, DEFAULT_FOLDER_ALERTS_AND_RINGTONES)
- && (!g_strcmp0(name, SUB_FODER_ALERTS) || !g_strcmp0(name, SUB_FODER_RINGTONES))) {
+ && (!g_strcmp0(name, SUB_FODER_ALERTS) || !g_strcmp0(name, SUB_FODER_RINGTONES))) {
*result = true;
} else if (!g_strcmp0(parent_name, DEFAULT_FOLDER_MUSIC)
- && (!g_strcmp0(name, SUB_FODER_FM) || !g_strcmp0(name, SUB_FODER_VOICE_RECORD))) {
+ && (!g_strcmp0(name, SUB_FODER_FM) || !g_strcmp0(name, SUB_FODER_VOICE_RECORD))) {
*result = true;
} else {
*result = false;
}
ret = metadata_extractor_set_path(handle, filename);
- if (ret != METADATA_EXTRACTOR_ERROR_NONE)
- {
+ if (ret != METADATA_EXTRACTOR_ERROR_NONE) {
mf_error("metadata_extractor_set_path().. %d", ret);
goto CATCH_ERROR;
}
if (ret == METADATA_EXTRACTOR_ERROR_NONE && value) {
if (g_strcmp0(value, "1") == 0) {
mf_error("ret is [%d] value is [%s]", ret, "1");
- if (handle)
- metadata_extractor_destroy(handle);
+ if (handle) {
+ metadata_extractor_destroy(handle);
+ }
MF_TRACE_END;
SAFE_FREE_CHAR(value);
return 1;
mf_error("ret is [%d] value is [%s]", ret, value);
SAFE_FREE_CHAR(value);
- if (handle)
+ if (handle) {
metadata_extractor_destroy(handle);
+ }
MF_TRACE_END;
return 0;
CATCH_ERROR:
- if (handle)
+ if (handle) {
metadata_extractor_destroy(handle);
+ }
MF_TRACE_END;
return 0;
if (check_option & MF_ERROR_CHECK_SRC_PARENT_DIR_EXIST) {
char *parent_path = NULL;
if (mf_file_attr_get_parent_path(src, &parent_path)) {
- if (!mf_file_exists(parent_path)) {
+ if (!mf_file_exists(parent_path)) {
SAFE_FREE_CHAR(parent_path);
- return MYFILE_ERR_DIR_NOT_FOUND;
- }
+ return MYFILE_ERR_DIR_NOT_FOUND;
}
+ }
SAFE_FREE_CHAR(parent_path);
}
if (check_option & MF_ERROR_CHECK_DST_PARENT_DIR_EXIST) {
char *parent_path = NULL;
if (mf_file_attr_get_parent_path(dst, &parent_path)) {
- if (!mf_file_exists(parent_path)) {
+ if (!mf_file_exists(parent_path)) {
SAFE_FREE_CHAR(parent_path);
- return MYFILE_ERR_DIR_NOT_FOUND;
- }
+ return MYFILE_ERR_DIR_NOT_FOUND;
}
+ }
SAFE_FREE_CHAR(parent_path);
}
}
if ((ent->d_type & DT_DIR) != 0) {
if ((strlen(path) == strlen(PHONE_FOLDER)) && (strcmp(path, PHONE_FOLDER) == 0)
- && (strlen(ent->d_name) == strlen(DEBUG_FOLDER)) && (strcmp(ent->d_name, DEBUG_FOLDER) == 0)) {
+ && (strlen(ent->d_name) == strlen(DEBUG_FOLDER)) && (strcmp(ent->d_name, DEBUG_FOLDER) == 0)) {
continue;
}
}
{
mf_debug();
int option = MF_ERROR_CHECK_SRC_ARG_VALID | MF_ERROR_CHECK_DST_ARG_VALID |
- MF_ERROR_CHECK_SRC_EXIST | MF_ERROR_CHECK_DST_PATH_VALID |
- MF_ERROR_CHECK_SRC_PATH_VALID | MF_ERROR_CHECK_SRC_PATH_VALID | MF_ERROR_CHECK_DST_PARENT_DIR_EXIST | MF_ERROR_CHECK_DUPLICATED;
+ MF_ERROR_CHECK_SRC_EXIST | MF_ERROR_CHECK_DST_PATH_VALID |
+ MF_ERROR_CHECK_SRC_PATH_VALID | MF_ERROR_CHECK_SRC_PATH_VALID | MF_ERROR_CHECK_DST_PARENT_DIR_EXIST | MF_ERROR_CHECK_DUPLICATED;
int ret = mf_fs_oper_error(src, dst, option);
if (ret != 0) {
assert(ap);
int changed_angle = elm_win_rotation_get(obj);
-/*
- enum ug_event new_event = UG_EVENT_ROTATE_PORTRAIT;
- switch (changed_angle) {
- case APP_DEVICE_ORIENTATION_0:
- new_event = UG_EVENT_ROTATE_PORTRAIT;
- break;
- case APP_DEVICE_ORIENTATION_90:
- new_event = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN;
- break;
- case APP_DEVICE_ORIENTATION_180:
- new_event = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN;
- break;
- case APP_DEVICE_ORIENTATION_270:
- new_event = UG_EVENT_ROTATE_LANDSCAPE;
- break;
+ /*
+ enum ug_event new_event = UG_EVENT_ROTATE_PORTRAIT;
+ switch (changed_angle) {
+ case APP_DEVICE_ORIENTATION_0:
+ new_event = UG_EVENT_ROTATE_PORTRAIT;
+ break;
+ case APP_DEVICE_ORIENTATION_90:
+ new_event = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN;
+ break;
+ case APP_DEVICE_ORIENTATION_180:
+ new_event = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN;
+ break;
+ case APP_DEVICE_ORIENTATION_270:
+ new_event = UG_EVENT_ROTATE_LANDSCAPE;
+ break;
+ }
+ ug_send_event(new_event);
+ */
+ const char *config = elm_config_profile_get();
+ if (!strcmp(config, "desktop")) {
+ return;
}
- ug_send_event(new_event);
-*/
- const char *config = elm_config_profile_get();
- if (!strcmp(config, "desktop"))
- return;
if (mf_view_is_root_view(ap)) {
} else {
if (changed_angle == APP_DEVICE_ORIENTATION_90 || changed_angle == APP_DEVICE_ORIENTATION_270) {
evas_object_size_hint_min_set(ap->mf_MainWindow.pPopupBox, -1,
- ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM/2)));
+ ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM / 2)));
} else {
evas_object_size_hint_min_set(ap->mf_MainWindow.pPopupBox, -1,
- ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM)));
+ ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM)));
}
- if (ap->mf_Status.view_type != mf_view_root_category && ap->mf_Status.view_type != mf_view_recent && ap->mf_Status.view_type != mf_view_storage)
+ if (ap->mf_Status.view_type != mf_view_root_category && ap->mf_Status.view_type != mf_view_recent && ap->mf_Status.view_type != mf_view_storage) {
mf_navi_bar_pathinfo_refresh(ap);
+ }
}
{
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
- mf_retm_if (ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
- mf_retm_if (ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
- mf_retm_if (path == NULL, "path is NULL");
- mf_retm_if (path->str == NULL, "path->str is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
+ mf_retm_if(path == NULL, "path is NULL");
+ mf_retm_if(path->str == NULL, "path->str is NULL");
if (mf_fm_svc_wrapper_is_dir(path)) {
GString *new_path = NULL;
if (ap->mf_Status.more == MORE_SEARCH) {
if (ap->mf_FileOperation.search_result_folder_list) {
- mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.search_result_folder_list), MYFILE_TYPE_ITEM_DATA);
+ mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.search_result_folder_list), MYFILE_TYPE_ITEM_DATA);
}
if (ap->mf_FileOperation.search_result_file_list) {
- mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.search_result_file_list), MYFILE_TYPE_ITEM_DATA);
+ mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.search_result_file_list), MYFILE_TYPE_ITEM_DATA);
}
elm_object_focus_set(ap->mf_MainWindow.pSearchEntry, EINA_FALSE);
ap->mf_Status.more = MORE_DEFAULT;
ap->mf_MainWindow.pNormalPopup = NULL;
Evas_Object *entry = ap->mf_MainWindow.pEntry;
- if (entry != NULL)
+ if (entry != NULL) {
elm_object_focus_set(entry, EINA_TRUE);
+ }
} else if ((g_strcmp0(label, mf_util_get_text(MF_BUTTON_LABEL_NO)) == 0) || (g_strcmp0(label, mf_util_get_text(LABEL_CANCEL)) == 0)) {
evas_object_del(ap->mf_MainWindow.pNormalPopup);
ap->mf_MainWindow.pNormalPopup = NULL;
mf_callback_cancel_cb(ap, NULL, NULL);
} else {//Fix the bug when pressing the back key.
Evas_Object *entry = ap->mf_MainWindow.pEntry;
- if (entry != NULL)
+ if (entry != NULL) {
elm_object_focus_set(entry, EINA_TRUE);
+ }
}
}
MF_TRACE_BEGIN;
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
- mf_retm_if (ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
- mf_retm_if (ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
mf_error("more is [%d]", ap->mf_Status.more);
} else if (ap->mf_Status.view_type == mf_view_recent) {
mf_navi_bar_title_content_set(ap, MF_LABEL_RECTENT_FILES);
} else {
- mf_navi_bar_title_content_set(ap,ap->mf_MainWindow.naviframe_title);
+ mf_navi_bar_title_content_set(ap, ap->mf_MainWindow.naviframe_title);
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_TRUE, EINA_TRUE);
}
} else if (ap->mf_Status.more != MORE_EDIT_RENAME) {
}
if (g_string_equal(item_data->m_ItemName, pre_name)) {
-
+
int hiden_state = 0;
mf_util_get_pref_value(PREF_TYPE_HIDEN_STATE, &hiden_state);
if (hiden_state == MF_HIDEN_HIDE) {
} else {
mf_callback_monitor_media_db_update_flag_set(EINA_TRUE);
if (item_data->file_type != FILE_TYPE_DIR) {
- if(strstr (from->str,"/.") != NULL && strstr (to->str, "/.") == NULL) {
+ if (strstr(from->str, "/.") != NULL && strstr(to->str, "/.") == NULL) {
mf_media_content_scan_file(to->str);
- } else if(strstr (from->str,"/.") == NULL && strstr (to->str, "/.") != NULL) {
+ } else if (strstr(from->str, "/.") == NULL && strstr(to->str, "/.") != NULL) {
mf_media_content_scan_file(from->str);
- } else if(strstr (from->str,"/.") == NULL && strstr (to->str, "/.") == NULL){
+ } else if (strstr(from->str, "/.") == NULL && strstr(to->str, "/.") == NULL) {
mf_media_content_scan_file(from->str);
mf_media_content_scan_file(to->str);
}
}
}
- if (ap->mf_Status.more == MORE_THUMBNAIL_RENAME || ap->mf_Status.more == MORE_EDIT_RENAME)
- {
+ if (ap->mf_Status.more == MORE_THUMBNAIL_RENAME || ap->mf_Status.more == MORE_EDIT_RENAME) {
//ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_TWO_BTN, NULL, message,LABEL_CANCEL, MF_BUTTON_LABEL_OK, NULL, mf_callback_illegal_char_popup_cb, ap);
mf_callback_entry_unfocus(pEntry);
mf_popup_second_popup_create(ap, ap->mf_MainWindow.pWindow, message,
- MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
+ MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
mf_callback_monitor_media_db_update_flag_set(EINA_FALSE);
mf_callback_monitor_internal_update_flag_set(EINA_FALSE);
return;
mf_object_entry_unfocus(ap->mf_MainWindow.pEntry);
name = mf_callback_entry_text_get(ap->mf_MainWindow.pEntry);
- SECURE_DEBUG("ap is [%p], name is [%s]", ap,name);
+ SECURE_DEBUG("ap is [%p], name is [%s]", ap, name);
if (name) {
if (strlen(name)) {
ap->mf_MainWindow.pEntry = NULL;
SAFE_FREE_OBJ(ap->mf_MainWindow.pNewFolderPopup);
mf_view_update(ap);
- //Prevent issue
+ //Prevent issue
/*if (ap->mf_Status.more == MORE_DEFAULT && noContentFlag) {
mf_navi_bar_set_ctrlbar_item_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_NOCONTENT_VIEW, false);
}*/
ap->mf_MainWindow.pEntry = NULL;
SAFE_FREE_OBJ(ap->mf_MainWindow.pNewFolderPopup);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, message,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_popup_error_exit_cb, ap);
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_popup_error_exit_cb, ap);
return;
assert(ap);
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
-
+
Evas_Object *playout = ap->mf_MainWindow.pNaviLayout;
mf_retm_if(playout == NULL, "get conformant failed");
Evas_Object *newContent = NULL;
assert(ap);
SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
-
+
mf_sort_by_respones_func_set(mf_callback_list_by_response_cb);
- ap->mf_MainWindow.pNormalPopup = mf_popup_sort_by_create(LABEL_SORT_BY_CHAP,mf_callback_popup_deleted_cb, ap);
+ ap->mf_MainWindow.pNormalPopup = mf_popup_sort_by_create(LABEL_SORT_BY_CHAP, mf_callback_popup_deleted_cb, ap);
}
/******************************
evas_object_hide(ap->mf_MainWindow.pButton);
}
if (ap->mf_MainWindow.pNaviItem) {
- Evas_Object *unset = elm_object_item_part_content_unset(ap->mf_MainWindow.pNaviItem, "prev_btn");
- evas_object_hide(unset);
+ Evas_Object *unset = elm_object_item_part_content_unset(ap->mf_MainWindow.pNaviItem, "prev_btn");
+ evas_object_hide(unset);
}
//__mf_callback_edit_share_view(ap);
MF_TRACE_BEGIN;
mf_retm_if(data == NULL, "data is NULL");
struct appdata *ap = (struct appdata *)data;
-
+
SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
if (ap->mf_MainWindow.pButton) {
elm_object_part_content_unset(ap->mf_MainWindow.pNaviLayout, "search_icon");
int count = mf_edit_file_count_get();
if (count > 1) {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_REMOVE,
- MF_LABEL_DELETE_RECENT_Q,
- LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
+ MF_LABEL_DELETE_RECENT_Q,
+ LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
} else {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_REMOVE,
- MF_LABEL_DELETE_THIS_RECENT,
- LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
+ MF_LABEL_DELETE_THIS_RECENT,
+ LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
}
}
MF_TRACE_BEGIN;
mf_retm_if(data == NULL, "data is NULL");
struct appdata *ap = (struct appdata *)data;
-
+
SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
ap->mf_Status.more = MORE_EDIT_UNINSTALL;
__mf_callback_edit_share_view(ap);
**/
void mf_callback_icu_update_cb(app_event_info_h event_info, void *data)
{
-/*
- ug_send_event(UG_EVENT_REGION_CHANGE);
-*/
+ /*
+ ug_send_event(UG_EVENT_REGION_CHANGE);
+ */
mf_debug("region changed");
assert(data);
struct appdata *ap = (struct appdata *)data;
- if (ap->mf_Status.flagIcuInit == FALSE)
+ if (ap->mf_Status.flagIcuInit == FALSE) {
return;
+ }
/* finalize the previous icu session */
mf_util_icu_finalize(ap);
/* start a new icu session*/
return ;
}
- if (ap->mf_Status.more != MORE_DEFAULT)
+ if (ap->mf_Status.more != MORE_DEFAULT) {
return ;
+ }
/*get current genlist */
Evas_Object *currgenlist = ap->mf_MainWindow.pNaviGenlist;
- if (currgenlist == NULL)
+ if (currgenlist == NULL) {
return ;
+ }
/*create new genlist */
mf_view_update(ap);
return ;
SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
- if (ap->mf_Status.more == MORE_THUMBNAIL_RENAME)
+ if (ap->mf_Status.more == MORE_THUMBNAIL_RENAME) {
return;
+ }
mf_view_state_set_with_pre(ap, MORE_THUMBNAIL_RENAME);
mf_popup_rename_func_reset();
MF_TRACE_BEGIN;
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
- evas_object_smart_callback_del (ap->mf_MainWindow.pEntry, "clicked", (Evas_Smart_Cb) mf_callback_clicked_cb);
+ evas_object_smart_callback_del(ap->mf_MainWindow.pEntry, "clicked", (Evas_Smart_Cb) mf_callback_clicked_cb);
// elm_entry_select_none(ap->mf_MainWindow.pEntry);
MF_TRACE_END;
}
MF_TRACE_BEGIN;
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
- char *message = g_strdup_printf(mf_util_get_text(MF_LABEL_MAX_CHARACTER_REACHED),MYFILE_FILE_NAME_CHAR_COUNT_MAX);
+ char *message = g_strdup_printf(mf_util_get_text(MF_LABEL_MAX_CHARACTER_REACHED), MYFILE_FILE_NAME_CHAR_COUNT_MAX);
mf_popup_indicator_popup(data, message);
SAFE_FREE_CHAR(message);
//mf_callback_entry_unfocus(obj);
MF_TRACE_BEGIN;
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
- mf_retm_if (ap->mf_MainWindow.pProgressPopup == NULL, "ap->mf_MainWindow.pProgressPopup is NULL");
+ mf_retm_if(ap->mf_MainWindow.pProgressPopup == NULL, "ap->mf_MainWindow.pProgressPopup is NULL");
mf_fo_msg *msg = ap->mf_FileOperation.pMessage;
char lable[10] = { '\0', };
total_count = ap->mf_FileOperation.iTotalCount;
count = msg->current_index;
mf_error("processing ,current_size[%d], total_size[%ld]", msg->current_size,
- msg->total_size);
+ msg->total_size);
value = (double)msg->current_size / msg->total_size;
//add protection to avoid the percent passed 100%
- if (value>1 && count <= total_count)
- {
- value = (double)count/total_count;
+ if (value > 1 && count <= total_count) {
+ value = (double)count / total_count;
}
elm_progressbar_value_set(ap->mf_FileOperation.progress_bar, value);
//mf_error("processing ,count=%d, total_count=%d, value is [%f]",count, total_count,value);
if (mf_util_get_eina_list_len(ap->mf_FileRecordList.value_saver) < 1) {
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
return;
}
{
mf_retm_if(data == NULL, "data is NULL");
struct appdata *ap = mf_get_appdata();
-
+
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
if (mf_edit_file_count_get() == 1) {
Eina_List *select_list = mf_edit_get_all_selected_files();
if (mf_util_get_eina_list_len(select_list) < 1) {
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
return;
}
int count = 0;
gchar *pDestPath = NULL;
- mf_retm_if (ap->mf_FileOperation.source == NULL, "ap->mf_FileOperation.source is NULL");
- mf_retm_if (ap->mf_FileOperation.source->str == NULL, "ap->mf_FileOperation.source is NULL");
+ mf_retm_if(ap->mf_FileOperation.source == NULL, "ap->mf_FileOperation.source is NULL");
+ mf_retm_if(ap->mf_FileOperation.source->str == NULL, "ap->mf_FileOperation.source is NULL");
- mf_retm_if (ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
- mf_retm_if (ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
ap->mf_FileOperation.destination = ap->mf_Status.path;
int count = 0;
gchar *pDestPath = NULL;
- mf_retm_if (ap->mf_FileOperation.source == NULL, "ap->mf_FileOperation.source is NULL");
- mf_retm_if (ap->mf_FileOperation.source->str == NULL, "ap->mf_FileOperation.source is NULL");
+ mf_retm_if(ap->mf_FileOperation.source == NULL, "ap->mf_FileOperation.source is NULL");
+ mf_retm_if(ap->mf_FileOperation.source->str == NULL, "ap->mf_FileOperation.source is NULL");
- mf_retm_if (ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
- mf_retm_if (ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
ap->mf_FileOperation.destination = ap->mf_Status.path;
if (mf_util_get_eina_list_len(ap->mf_FileRecordList.value_saver) < 1) {
ap->mf_MainWindow.pNormalPopup =
- mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
} else {
GList *pSourceList = NULL;
int count = 0;
ap->mf_FileOperation.iOperationSuccessFlag = TRUE;
mf_fs_monitor_remove_dir_watch();
ap->mf_MainWindow.pProgressPopup =
- mf_popup_create_pb_popup(ap, LABEL_DELETE, MF_MSG_DELETING, count, mf_callback_progress_bar_cancel_cb, ap);
+ mf_popup_create_pb_popup(ap, LABEL_DELETE, MF_MSG_DELETING, count, mf_callback_progress_bar_cancel_cb, ap);
} else {
mf_util_exception_func(ap);
}
int count = mf_edit_file_count_get();
if (count > 1) {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, LABEL_DELETE,
- MF_LABEL_ITEMS_WILL_DELETE,
- LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
+ MF_LABEL_ITEMS_WILL_DELETE,
+ LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
} else {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap,
- LABEL_DELETE,
- MF_LABEL_THIS_ITEM_WILL_DELETE,
- LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
+ LABEL_DELETE,
+ MF_LABEL_THIS_ITEM_WILL_DELETE,
+ LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
}
}
void mf_callback_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
- struct appdata *ap =(struct appdata *)data;
+ struct appdata *ap = (struct appdata *)data;
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
mf_request_set_result(ap->mf_FileOperation.pRequest, MF_REQ_CANCEL);
}
void mf_callback_rename_cb(void *data, Evas_Object *obj, void *event_info)
{
- struct appdata *ap =(struct appdata *)data;
+ struct appdata *ap = (struct appdata *)data;
ap->mf_Status.req = MF_REQ_RENAME;
mf_request_set_result(ap->mf_FileOperation.pRequest, MF_REQ_RENAME);
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
void mf_callback_replace_cb(void *data, Evas_Object *obj, void *event_info)
{
- struct appdata *ap =(struct appdata *)data;
+ struct appdata *ap = (struct appdata *)data;
ap->mf_Status.req = MF_REQ_NONE;
mf_request_set_result(ap->mf_FileOperation.pRequest, MF_REQ_NONE);
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
if (pPipeMsg->msg_type == MF_MSG_REQUEST && ap->mf_Status.check != 1) {
GString *path = g_string_new(pPipeMsg->current);
- if(mf_fm_svc_wrapper_is_dir(path) == FILE_TYPE_DIR) {
+ if (mf_fm_svc_wrapper_is_dir(path) == FILE_TYPE_DIR) {
char *label = gettext(MF_LABEL_SAME_FOLDER_LABEL);
ap->file_name = mf_fm_svc_get_file_name(path);
char *message = g_strdup_printf(label, ap->file_name);
ap->mf_MainWindow.pNormalPopup = mf_popup_replace_create(MF_LABEL_SAME_FOLDER, message, mf_callback_popup_cancel_cb,
- mf_callback_replace_cb, mf_callback_rename_cb, ap);
+ mf_callback_replace_cb, mf_callback_rename_cb, ap);
} else {
char *label = gettext(MF_LABEL_SAME_FILE_LABEL);
ap->file_name = mf_fm_svc_get_file_name(path);
char *message = g_strdup_printf(label, ap->file_name);
ap->mf_MainWindow.pNormalPopup = mf_popup_replace_create(MF_LABEL_SAME_FILE, message, mf_callback_popup_cancel_cb,
- mf_callback_replace_cb, mf_callback_rename_cb, ap);
+ mf_callback_replace_cb, mf_callback_rename_cb, ap);
}
}
mf_util_set_pm_lock(ap, EINA_TRUE);
ap->mf_MainWindow.pProgressPopup = NULL;
}
ap->mf_MainWindow.pFinishPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_CANCELING, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_CANCELING, NULL, NULL, NULL, NULL, NULL);
mf_msg_request_handled_send();
ap->mf_FileOperation.iOperationSuccessFlag = FALSE;
break;
} else {
ap->mf_FileOperation.pOperationMsg = message;
}
- }
- else {
+ } else {
if (ap->mf_Status.more == MORE_DATA_COPYING) {
ap->mf_FileOperation.pOperationMsg = MF_MSG_COPY_FAILED;
} else if (ap->mf_Status.more == MORE_DATA_MOVING) {
{
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "appdata is NULL");
- mf_retm_if (ap->mf_Status.path == NULL || ap->mf_Status.path->str == NULL, "mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL || ap->mf_Status.path->str == NULL, "mf_Status.path is NULL");
Evas_Object *entry = NULL;
ap->mf_Status.iStorageState |= MYFILE_MMC;
- if (ap->mf_Status.more == MORE_SEARCH || (ap->mf_Status.more == MORE_RENAME && mf_view_get_pre_state(ap) == MORE_SEARCH))
+ if (ap->mf_Status.more == MORE_SEARCH || (ap->mf_Status.more == MORE_RENAME && mf_view_get_pre_state(ap) == MORE_SEARCH)) {
return;
+ }
if (ap->mf_Status.view_type != mf_view_storage && ap->mf_Status.view_type != mf_view_root) {
return;
{
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "appdata is NULL");
- mf_retm_if (ap->mf_Status.path == NULL || ap->mf_Status.path->str == NULL, "mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL || ap->mf_Status.path->str == NULL, "mf_Status.path is NULL");
Evas_Object *entry = NULL;
MF_STORAGE optStorage = MYFILE_NONE;
*/
mf_media_delete_recent_files_by_type(ap->mf_MainWindow.mfd_handle, MYFILE_MMC);
if (ap->mf_Status.view_type == mf_view_recent) {
- mf_recent_view_content_refresh(ap);
+ mf_recent_view_content_refresh(ap);
}
if (ap->mf_MainWindow.pNewFolderPopup) {
mf_list_data_t *item_data = (mf_list_data_t *)evas_object_data_get(ap->mf_MainWindow.pNewFolderPopup, "item_data");
SAFE_FREE_OBJ(ap->mf_MainWindow.pNewFolderPopup);
}
}
- if(mf_fm_svc_wrapper_get_location(ap->mf_Status.path->str) == MYFILE_MMC) {
+ if (mf_fm_svc_wrapper_get_location(ap->mf_Status.path->str) == MYFILE_MMC) {
if (ap->mf_MainWindow.pLongpressPopup) {
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
}
case MORE_DATA_COPYING:
case MORE_DATA_MOVING:
mf_debug("===================== MMC remove ==================");
- if(strncmp(ap->mf_MainWindow.record.path , storage_loc, strlen(storage_loc)) == 0) {
+ if (strncmp(ap->mf_MainWindow.record.path , storage_loc, strlen(storage_loc)) == 0) {
if (ap->mf_MainWindow.pNormalPopup) {
- evas_object_del(ap->mf_MainWindow.pNormalPopup);
- ap->mf_MainWindow.pNormalPopup = NULL;
+ evas_object_del(ap->mf_MainWindow.pNormalPopup);
+ ap->mf_MainWindow.pNormalPopup = NULL;
}
mf_request_set_result(ap->mf_FileOperation.pRequest, MF_REQ_SKIP);
}
if (ap->mf_MainWindow.record.location == optStorage) {
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
}
break;
mf_debug("===================== MMC remove ==================");
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
/*ToDo: check whether get the error before this; */
if (ap->mf_FileOperation.pCancel) {
mf_cancel_do_cancel(ap->mf_FileOperation.pCancel);
ap->mf_MainWindow.pProgressPopup = NULL;
}
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
mf_navi_bar_reset(ap);
mf_view_update(ap);
case MORE_DELETE:
mf_debug("===================== MMC remove ==================");
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
if (ap->mf_FileOperation.pCancel) {
mf_cancel_do_cancel(ap->mf_FileOperation.pCancel);
}
{
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "appdata is NULL");
- mf_retm_if (ap->mf_Status.path == NULL || ap->mf_Status.path->str == NULL, "mf_Status.path is NULL");
+ mf_retm_if(ap->mf_Status.path == NULL || ap->mf_Status.path->str == NULL, "mf_Status.path is NULL");
int optStorage = MYFILE_NONE;
if (STORAGE_STATE_MOUNTED == state) {
if (elm_object_focus_get(obj)) {
if (entry_empty) {
elm_object_item_signal_emit(params->item, "elm,state,eraser,hide", "");
- }
- else
- {
+ } else {
elm_object_item_signal_emit(params->item, "elm,state,eraser,show", "");
}
}
if (mf_file_attr_is_valid_name(name) != MYFILE_ERR_NONE) {
strncpy(new_str, name, MYFILE_FILE_NAME_LEN_MAX - 1);
- if (strlen(name) > 0)
+ if (strlen(name) > 0) {
new_str[strlen(name) - 1] = '\0';
+ }
elm_entry_entry_set(ap->mf_MainWindow.pEntry, new_str);
elm_entry_cursor_end_set(ap->mf_MainWindow.pEntry);
elm_object_focus_set(ap->mf_MainWindow.pEntry, EINA_FALSE);
}
mf_callback_entry_unfocus(ap->mf_MainWindow.pEntry);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_MSG_RENAME_ILLEGAL_CHAR, MF_BUTTON_LABEL_OK, NULL,
- NULL, mf_popup_show_vk_cb, ap);
+ NULL, mf_popup_show_vk_cb, ap);
}
SAFE_FREE_CHAR(name);
MF_TRACE_END;
ap->mf_FileOperation.rename_item = it;
//__mf_callback_idle_rename(data);
SAFE_DEL_ECORE_TIMER(ap->mf_Status.rename_timer);
- ap->mf_Status.rename_timer = ecore_timer_add(0.05,(Ecore_Task_Cb)mf_callback_idle_rename, data);
+ ap->mf_Status.rename_timer = ecore_timer_add(0.05, (Ecore_Task_Cb)mf_callback_idle_rename, data);
return;
}
//mf_launch_load_ug(ap, itemData->m_ItemName->str, MF_LOAD_UG_DETAIL, EINA_FALSE);
__mf_load_detail_data(ap, itemData->m_ItemName->str, EINA_FALSE);
-
+
ap->mf_Status.preViewType = ap->mf_Status.view_type;
ap->mf_Status.view_type = mf_view_detail;
mf_view_update(ap);
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
ap->mf_FileOperation.idle_delete_item = params->item;
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_DELETE_ITEM,
- MF_LABEL_THIS_ITEM_WILL_DELETE,
- LABEL_CANCEL, LABEL_DELETE,
- __mf_callback_delete_in_idle, ap, 1);
+ MF_LABEL_THIS_ITEM_WILL_DELETE,
+ LABEL_CANCEL, LABEL_DELETE,
+ __mf_callback_delete_in_idle, ap, 1);
}
void mf_callback_view_as_cb(void *data, Evas_Object *obj, void *event_info)
} else {
if (ap->mf_Status.more == MORE_DEFAULT) {
mf_context_popup_create_more(ap, more);
- } else if (ap->mf_Status.more == MORE_SEARCH){
+ } else if (ap->mf_Status.more == MORE_SEARCH) {
mf_context_popup_create_more(ap, more);
} else if (ap->mf_Status.more == MORE_INTERNAL_MOVE
- || ap->mf_Status.more == MORE_DATA_MOVING
- || ap->mf_Status.more == MORE_INTERNAL_COPY
- || ap->mf_Status.more == MORE_DATA_COPYING) {
+ || ap->mf_Status.more == MORE_DATA_MOVING
+ || ap->mf_Status.more == MORE_INTERNAL_COPY
+ || ap->mf_Status.more == MORE_DATA_COPYING) {
if (ap->mf_Status.view_type != mf_view_root && ap->mf_Status.view_type != mf_view_storage) {
mf_context_popup_create_more(ap, more);
}
void mf_callback_profile_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
- MF_TRACE_BEGIN;
+ MF_TRACE_BEGIN;
t_start;
- mf_retm_if(data == NULL, "data is NULL");
- struct appdata *ap = (struct appdata *)data;
- const char *profile = elm_config_profile_get();
-
- if (!strcmp(profile, "desktop")) {
- elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "prev_btn", NULL);
- elm_win_indicator_mode_set(ap->mf_MainWindow.pWindow, ELM_WIN_INDICATOR_HIDE);
- } else { // mobile
- elm_win_indicator_mode_set(ap->mf_MainWindow.pWindow, ELM_WIN_INDICATOR_SHOW);
- }
+ mf_retm_if(data == NULL, "data is NULL");
+ struct appdata *ap = (struct appdata *)data;
+ const char *profile = elm_config_profile_get();
+
+ if (!strcmp(profile, "desktop")) {
+ elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "prev_btn", NULL);
+ elm_win_indicator_mode_set(ap->mf_MainWindow.pWindow, ELM_WIN_INDICATOR_HIDE);
+ } else { // mobile
+ elm_win_indicator_mode_set(ap->mf_MainWindow.pWindow, ELM_WIN_INDICATOR_SHOW);
+ }
t_end;
MF_TRACE_END;
}
if (mf_edit_file_count_get() > MF_SHARE_ITEM_COUNT_MAX) {
//P131118-02783 by wangyan , add detailed maximum number in the popup message while share
char limit_str[256] = {0};
- snprintf(limit_str, sizeof(limit_str)-1, mf_util_get_text(MF_LABEL_REACH_MAX_SHARE_COUNT), MF_SHARE_ITEM_COUNT_MAX);
+ snprintf(limit_str, sizeof(limit_str) - 1, mf_util_get_text(MF_LABEL_REACH_MAX_SHARE_COUNT), MF_SHARE_ITEM_COUNT_MAX);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, limit_str/*MF_LABEL_REACH_MAX_SHARE_COUNT*/, MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
return;
}
SAFE_FREE_CHAR(pListData->thumb_path);
if (pListData->file_type == FILE_TYPE_MUSIC || pListData->file_type == FILE_TYPE_SOUND) {
- if (strcmp(path,MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB) == 0) {
- mf_debug("if in get the path from db is [%s]",path);
+ if (strcmp(path, MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB) == 0) {
+ mf_debug("if in get the path from db is [%s]", path);
pListData->thumb_path = g_strdup(MF_ICON_MUSIC_THUMBNAIL);
pListData->thumbnail_type = MF_THUMBNAIL_DEFAULT;
- }else
- {
- mf_debug("else in get the path from db is [%s]",path);
+ } else {
+ mf_debug("else in get the path from db is [%s]", path);
pListData->thumb_path = g_strdup(path);
pListData->thumbnail_type = MF_THUMBNAIL_THUMB;
}
- }else {
+ } else {
pListData->thumb_path = g_strdup(path);
pListData->thumbnail_type = MF_THUMBNAIL_THUMB;
}
if (g_mf_create_thumbnail_count < MF_MAX_MAKE_THUNBNAIL_COUNT) {//Fixed P140827-07370
ret = media_info_create_thumbnail(pListData->media, callback,
- pListData);
+ pListData);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
mf_debug("Failed to create thumbnail! ret is [%d]", ret);
if (pListData->file_type == FILE_TYPE_IMAGE || pListData->file_type == FILE_TYPE_VIDEO) {
struct appdata *ap = (struct appdata*)data;
Elm_Object_Item *navi_it = event_info;
- if (!navi_it) return;
+ if (!navi_it) {
+ return;
+ }
Evas_Object *label = elm_object_item_part_content_get(navi_it, "elm.swallow.title");
- if (!label || (ap->mf_Status.more == MORE_EDIT))
+ if (!label || (ap->mf_Status.more == MORE_EDIT)) {
return;
+ }
elm_label_slide_go(label);
}
Evas_Object *nf = ap->mf_MainWindow.pNaviBar;
- if (!nf) return;
+ if (!nf) {
+ return;
+ }
Elm_Object_Item *navi_it = elm_naviframe_top_item_get(nf);
- if (!navi_it) return;
+ if (!navi_it) {
+ return;
+ }
elm_object_item_signal_emit(navi_it, "elm,state,toolbar,instant_open", "");
MF_TRACE_END;
Evas_Object *nf = ap->mf_MainWindow.pNaviBar;
- if (!nf) return;
+ if (!nf) {
+ return;
+ }
Elm_Object_Item *navi_it = elm_naviframe_top_item_get(nf);
- if (!navi_it) return;
+ if (!navi_it) {
+ return;
+ }
elm_object_item_signal_emit(navi_it, "elm,state,toolbar,instant_close", "");
MF_TRACE_END;
void mf_callback_entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
{
- if (!elm_entry_is_empty(obj))
+ if (!elm_entry_is_empty(obj)) {
elm_object_signal_emit(data, "elm,state,eraser,show", "");
+ }
elm_object_signal_emit(data, "elm,state,rename,hide", "");
}
struct appdata *ap = (struct appdata *)data;
Evas_Event_Key_Down *ev = event_info;
- if (!strcmp(ev->keyname, "Escape")) // if ESC key is down
- {
+ if (!strcmp(ev->keyname, "Escape")) { // if ESC key is down
elm_naviframe_item_pop_cb_set(ap->mf_MainWindow.pNaviItem, mf_callback_navi_backbutton_clicked_cb, ap);
}
}
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap,
- POPMODE_TEXT_TWO_BTN,
- MF_LABEL_REMOVE_FILE,
- MF_LABEL_REMOVE_FROME_RECENT,
- LABEL_CANCEL,
- MF_LABEL_REMOVE,
- NULL,
- __mf_callback_recent_files_confirm_delete,
- item_data);
+ POPMODE_TEXT_TWO_BTN,
+ MF_LABEL_REMOVE_FILE,
+ MF_LABEL_REMOVE_FROME_RECENT,
+ LABEL_CANCEL,
+ MF_LABEL_REMOVE,
+ NULL,
+ __mf_callback_recent_files_confirm_delete,
+ item_data);
//elm_object_item_del(item_data->item);
{
const char *domain;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
domain = "sys_string";
- else
+ } else {
domain = DETAIL_UG_PKGNAME;
+ }
elm_object_domain_translatable_part_text_set(obj, part, domain, ID);
}
{
const char *domain;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
domain = "sys_string";
- else
+ } else {
domain = DETAIL_UG_PKGNAME;
+ }
elm_object_item_domain_translatable_part_text_set(item, part, domain, ID);
}
{
const char *domain;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
domain = "sys_string";
- else
+ } else {
domain = DETAIL_UG_PKGNAME;
+ }
elm_object_item_domain_text_translatable_set(item, domain, EINA_TRUE);
}
void mf_detail_data_destroy(void *data)
{
MF_TRACE_BEGIN;
- if (data == NULL)
+ if (data == NULL) {
return;
-
+ }
+
struct appdata *ap = (struct appdata *)data;
if (ap->mf_Status.detail) {
mf_ug_detail_view_destroy_data(ap->mf_Status.detail);
unit = strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_B));
if (unit != NULL && strstr(unit, mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_B))) {//Sometimes, the string isn't translated.
size = detail->mf_Info.dsize;
- strncpy(unit ,"B", sizeof("B"));
+ strncpy(unit , "B", sizeof("B"));
}
-
+
} else if (detail->mf_Info.unit_num == UG_SIZE_KB) {
unit = strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_K));
if (unit != NULL && strstr(unit, mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_K))) {//Sometimes, the string isn't translated.
size = 1024 * detail->mf_Info.dsize;
- strncpy(unit ,"KB", sizeof("KB"));
+ strncpy(unit , "KB", sizeof("KB"));
}
} else if (detail->mf_Info.unit_num == UG_SIZE_MB) {
unit = strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_M));
if (unit != NULL && strstr(unit, mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_M))) {//Sometimes, the string isn't translated.
size = 1024 * 1024 * detail->mf_Info.dsize;
- strncpy(unit ,"MB", sizeof("MB"));
+ strncpy(unit , "MB", sizeof("MB"));
}
} else if (detail->mf_Info.unit_num == UG_SIZE_GB) {
unit = strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_G));
- if (unit !=NULL && strstr(unit, mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_G))) {//Sometimes, the string isn't translated.
- size = 1024 * 1024 * 1024 *detail->mf_Info.dsize;
- strncpy(unit ,"GB", sizeof("GB"));
+ if (unit != NULL && strstr(unit, mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_SIZE_G))) { //Sometimes, the string isn't translated.
+ size = 1024 * 1024 * 1024 * detail->mf_Info.dsize;
+ strncpy(unit , "GB", sizeof("GB"));
}
}
-
+
snprintf(filesize, UG_FILE_SIZE_LEN_MAX, "%.1f %s (%.0f bytes)", detail->mf_Info.dsize, unit, size);
SAFE_FREE_CHAR(unit);
// snprintf(filesize, UG_FILE_SIZE_LEN_MAX, "%llu %s", detail->mf_Info.dsize, unit);
struct detailData *detail = (struct detailData *)params->detail;
ug_detail_retvm_if(detail == NULL, NULL, "detail is NULL");
-
+
if (strcmp(part, "elm.text.main.left.top") == 0) {
if (params->m_ItemName && params->m_ItemName->str) {
return strdup(mf_detail_widget_get_text(params->m_ItemName->str));
static char *__mf_ug_detail_view_get_gl_label_title(void *data, Evas_Object *obj, const char *part)
{
UG_DETAIL_TRACE_BEGIN;
- if (!strcmp(part, "elm.text.main"))
+ if (!strcmp(part, "elm.text.main")) {
return strdup(data);
+ }
return NULL;
}
{
UG_DETAIL_TRACE_BEGIN;
- ug_detail_retvm_if(parent == NULL,NULL, "parent is NULL");
- ug_detail_retvm_if(data == NULL,NULL, "data is NULL");
+ ug_detail_retvm_if(parent == NULL, NULL, "parent is NULL");
+ ug_detail_retvm_if(data == NULL, NULL, "data is NULL");
struct detailData *detail = (struct detailData *) data;
Evas_Object *genlist = NULL;
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
evas_object_smart_callback_add(genlist, "language,changed",
- __mf_ug_genlist_lang_changed, detail);
+ __mf_ug_genlist_lang_changed, detail);
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
for (index = 0; index < 5; index++) {
m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
- if (m_TempItem == NULL)
+ if (m_TempItem == NULL) {
continue;
+ }
memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
for (index = 0; index < 2; index++) {
m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
- if (m_TempItem == NULL)
+ if (m_TempItem == NULL) {
continue;
+ }
memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
******************************/
static void __mf_ug_detail_view_create_genlist_gps(void *data)
{
-/*
- UG_DETAIL_TRACE_BEGIN;
- struct detailData *detail = (struct detailData *)data;
- ug_detail_retm_if(detail == NULL, "detail is NULL");
+ /*
+ UG_DETAIL_TRACE_BEGIN;
+ struct detailData *detail = (struct detailData *)data;
+ ug_detail_retm_if(detail == NULL, "detail is NULL");
- Evas_Object *genlist = NULL;
- int index = 0;
- Elm_Object_Item *git = NULL;
- Elm_Object_Item *it = NULL;
- struct MF_LIST_Item_S *m_TempItem = NULL;
- char *m_ItemName[FILE_EXIF_INFO_NUM] = { '\0' };
+ Evas_Object *genlist = NULL;
+ int index = 0;
+ Elm_Object_Item *git = NULL;
+ Elm_Object_Item *it = NULL;
+ struct MF_LIST_Item_S *m_TempItem = NULL;
+ char *m_ItemName[FILE_EXIF_INFO_NUM] = { '\0' };
- ug_detail_retm_if(genlist == NULL, "genlist is NULL");
+ ug_detail_retm_if(genlist == NULL, "genlist is NULL");
- m_ItemName[0] = MF_UG_DETAIL_LABEL_LATITUDE;
- m_ItemName[1] = MF_UG_DETAIL_LABEL_LONGITUDE;
+ m_ItemName[0] = MF_UG_DETAIL_LABEL_LATITUDE;
+ m_ItemName[1] = MF_UG_DETAIL_LABEL_LONGITUDE;
- git = elm_genlist_item_append(genlist, &detail->mf_Status.title_itc, strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_INFORMATION)),
- NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ git = elm_genlist_item_append(genlist, &detail->mf_Status.title_itc, strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_INFORMATION)),
+ NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- for (index = 0; index < FILE_EXIF_INFO_NUM; index++) {
- m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
- if (m_TempItem == NULL)
- continue;
+ for (index = 0; index < FILE_EXIF_INFO_NUM; index++) {
+ m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
+ if (m_TempItem == NULL)
+ continue;
- memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
- m_TempItem->m_ItemName = g_string_new(m_ItemName[index]);
- m_TempItem->detail = detail;
- it = elm_genlist_item_append(genlist, &detail->mf_Status.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
+ m_TempItem->m_ItemName = g_string_new(m_ItemName[index]);
+ m_TempItem->detail = detail;
+ it = elm_genlist_item_append(genlist, &detail->mf_Status.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- }
- UG_DETAIL_TRACE_END;
- */
+ }
+ UG_DETAIL_TRACE_END;
+ */
}
/******************************
ug_detail_retm_if(genlist == NULL, "genlist is NULL");
if (detail->mf_Status.view_type == VIEW_FILE_NORMAL
- ) {
+ ) {
char *m_ItemName[FOLDER_NORMDETILES_NUM] = { '\0' };
m_ItemName[0] = MF_UG_DETAIL_LABEL_NAME;
m_ItemName[3] = MF_UG_DETAIL_LABEL_LOCATION;
for (index = 0; index < FOLDER_NORMDETILES_NUM; index++) {
m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
- if (m_TempItem == NULL)
+ if (m_TempItem == NULL) {
continue;
+ }
memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
m_TempItem->detail = detail;
if (index == 0 || index == 4) {
it = elm_genlist_item_append(genlist, &detail->mf_Status.multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,
- NULL, NULL);
+ NULL, NULL);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
} else {
it = elm_genlist_item_append(genlist, &detail->mf_Status.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,
- NULL, NULL);
+ NULL, NULL);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
}
- }
- else if (
- detail->mf_Status.view_type == VIEW_FILE_IMAGE
- || detail->mf_Status.view_type == VIEW_FILE_VIDEO) {
+ } else if (
+ detail->mf_Status.view_type == VIEW_FILE_IMAGE
+ || detail->mf_Status.view_type == VIEW_FILE_VIDEO) {
char *m_ItemName[FILE_DETILES_NUM] = { '\0' };
m_ItemName[0] = MF_UG_DETAIL_LABEL_NAME;
m_ItemName[3] = MF_UG_DETAIL_LABEL_LOCATION;
for (index = 0; index < FILE_DETILES_NUM; index++) {
m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
- if (m_TempItem == NULL)
+ if (m_TempItem == NULL) {
continue;
+ }
memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
m_TempItem->detail = detail;
if (index == 0 || index == FILE_DETILES_NUM - 1) {
it = elm_genlist_item_append(genlist, &detail->mf_Status.multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,
- NULL, NULL);
+ NULL, NULL);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
} else {
it = elm_genlist_item_append(genlist, &detail->mf_Status.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,
- NULL, NULL);
+ NULL, NULL);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
}
m_ItemName[3] = MF_UG_DETAIL_LABEL_LOCATION;
git = elm_genlist_item_append(genlist, &detail->mf_Status.title_itc, strdup(mf_detail_widget_get_text(MF_UG_DETAIL_LABEL_BASIC)),
- NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
for (index = 0; index < FILE_DETILES_NUM; index++) {
m_TempItem = (struct MF_LIST_Item_S *) malloc(sizeof(struct MF_LIST_Item_S));
- if (m_TempItem == NULL)
+ if (m_TempItem == NULL) {
continue;
+ }
memset(m_TempItem, 0, sizeof(struct MF_LIST_Item_S));
if (index == 0 || index == FILE_DETILES_NUM - 1) {
it = elm_genlist_item_append(genlist, &detail->mf_Status.multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,
- NULL, NULL);
+ NULL, NULL);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
} else {
it = elm_genlist_item_append(genlist, &detail->mf_Status.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE,
- NULL, NULL);
+ NULL, NULL);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
}
}
void mf_ug_detail_get_multi_information(Eina_List *list, int *total_file_count,
- int *total_folder_count,
- unsigned long long int *total_size)
+ int *total_folder_count,
+ unsigned long long int *total_size)
{
Eina_List *l = NULL;
char *file_path = NULL;
} else {
file_count++;
Node_Info *pNode = (Node_Info *) malloc(sizeof(Node_Info));
- if (pNode == NULL)
+ if (pNode == NULL) {
return;
+ }
memset(pNode, 0, sizeof(Node_Info));
mf_ug_detaill_fs_get_file_stat(file_path, &pNode);
mf_ug_detail_multi_info_extract(const char *path)
{
UG_DETAIL_TRACE_BEGIN;
- ug_detail_retvm_if(path == NULL,false, "path is null");
+ ug_detail_retvm_if(path == NULL, false, "path is null");
Eina_List *path_list = NULL;
int file_count = 0;
mf_ug_detail_get_params_path(&path_list, path);
mf_ug_detail_get_multi_information(path_list, &file_count,
- &folder_count, &original_size);
+ &folder_count, &original_size);
size = (double)original_size;
while (size >= BASIC_SIZE) {
#include "mf-file-util.h"
static GList *download_app_list = NULL;
-typedef struct
-{
+typedef struct {
pthread_t tid;
int alive;
downloadapp_data *ad;
Ecore_Idler *worker_idler;
-}download_app_worker;
+} download_app_worker;
int count;//wangyan for test
static inline char *mf_download_app_strdup(const char *str)
{
- if (str != NULL)
+ if (str != NULL) {
return strdup(str);
- else
+ } else {
return NULL;
+ }
}
static inline char *mf_download_app_check_icon(const char *icon_path)
{
- if (EINA_TRUE == mf_file_exists(icon_path))
+ if (EINA_TRUE == mf_file_exists(icon_path)) {
return strdup(icon_path);
- else
+ } else {
return NULL;
+ }
}
static void mf_download_app_get_listinfo(package_info_h handle,
- downloadapp_listinfo *info)
+ downloadapp_listinfo *info)
{
MF_TRACE_BEGIN;
int ret = 0;
char *value;
- mf_ret_if(NULL == handle,-1);
- mf_ret_if(NULL == info,-1);
+ mf_ret_if(NULL == handle, -1);
+ mf_ret_if(NULL == info, -1);
value = NULL;
ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &value);
- if (ret < 0)
+ if (ret < 0) {
mf_error("pkgmgrinfo_pkginfo_get_pkgid() Fail(%d)", ret);
+ }
info->pkgid = mf_download_app_strdup(value);
value = NULL;
ret = package_info_get_label(handle, &value);
- if (ret != PACKAGE_MANAGER_ERROR_NONE)
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
mf_error("package_info_get_label() Fail(%d)", ret);
+ }
info->pkg_label = mf_download_app_strdup(value);
value = NULL;
ret = package_info_get_package(handle, &value);
- if (ret != PACKAGE_MANAGER_ERROR_NONE)
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
mf_error("package_info_get_package() Fail(%d)", ret);
+ }
info->mainappid = mf_download_app_strdup(value);
value = NULL;
ret = package_info_get_icon(handle, &value);
- if (ret != PACKAGE_MANAGER_ERROR_NONE)
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
mf_error("package_info_get_icon() Fail(%d)", ret);
+ }
info->icon_path = mf_download_app_check_icon(value);
ret = package_info_is_preload_package(handle, &info->is_preload);
- if (ret != PACKAGE_MANAGER_ERROR_NONE)
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
mf_error("package_info_is_preload_package() Fail(%d)", ret);
+ }
//ret = package_info_is_update(handle, &info->is_update);
//if (ret != PACKAGE_MANAGER_ERROR_NONE)
value = NULL;
ret = package_info_get_type(handle, &value);
- if (ret != PACKAGE_MANAGER_ERROR_NONE)
+ if (ret != PACKAGE_MANAGER_ERROR_NONE) {
mf_error("package_info_get_type() Fail(%d)", ret);
+ }
info->pkg_type = mf_download_app_strdup(value);
MF_TRACE_END;
}
if (info->is_preload && !info->is_update) {
invalid = 1; //not download app
- mf_error("------------------[%s] app is not donwload app---------------------",info->pkgid);
+ mf_error("------------------[%s] app is not donwload app---------------------", info->pkgid);
}
if (invalid == 0) {
- mf_error("------------------[%s] app is donwload app, count is [%d]---------------------",info->pkgid,count);
- if (count <= 15)//wangyan for test
+ mf_error("------------------[%s] app is donwload app, count is [%d]---------------------", info->pkgid, count);
+ if (count <= 15) { //wangyan for test
*pkg_list = g_list_append(*pkg_list, info);
+ }
}
MF_TRACE_END;
void mf_download_app_list_get_cb(int fn_result, downloadapp_data *da)
{
MF_TRACE_BEGIN;
- mf_ret_if(NULL == da,-1);
+ mf_ret_if(NULL == da, -1);
if (MYFILE_ERR_NONE != fn_result) {
mf_error("appmgrUg_get_listinfos() Fail(%d)", fn_result);
void mf_download_app_destroy_data(downloadapp_data *da)
{
- if (da->list_worker)
+ if (da->list_worker) {
da->list_worker = NULL;
+ }
//destroy data
}
pthread_join(worker->tid, NULL);
worker->alive = FALSE;
- if (worker->cb)
+ if (worker->cb) {
worker->cb(worker->fn_ret, worker->ad);
+ }
//g_hash_table_remove(async_worker_hashT, worker);
}
void* mf_download_app_start_async_worker(async_fn fn, callback_fn cb,
- downloadapp_data *ad)
+ downloadapp_data *ad)
{
MF_TRACE_BEGIN;
int ret;
//g_hash_table_add(async_worker_hashT, worker);
ret = pthread_create(&worker->tid, NULL, _async_worker_thread, worker);
- if (ret)
+ if (ret) {
mf_error("phread_create() Fail(%d)", ret);
+ }
worker->alive = TRUE;
GList *mf_download_app_data_list_get()
{
- mf_info("download_app_list count in data list get: [%d]",g_list_length(download_app_list));
+ mf_info("download_app_list count in data list get: [%d]", g_list_length(download_app_list));
return download_app_list;
}
da->data = (struct appdata *)data;
da->list_worker = NULL;
da->list_worker = mf_download_app_start_async_worker(mf_download_app_list_get,
- mf_download_app_list_get_cb, da);
+ mf_download_app_list_get_cb, da);
MF_TRACE_END;
}
#endif
int err = MYFILE_ERR_NONE;
char buf[256] = {0,};
char *str = (char *)strerror_r(err_no, buf, 256);
-
+
mf_error("err_no is [%d] error - %s", err_no, str);
switch (err_no) {
#ifdef EINVAL
const char *mf_file_get(const char path[])
{
char *file = NULL;
- if ((file = strrchr(path, '/')))
+ if ((file = strrchr(path, '/'))) {
file++;
- else
+ } else {
file = (char *) path;
+ }
return file;
}
if (!p) {
return strdup(path);
}
- if (p == buf)
+ if (p == buf) {
return strdup("/");
+ }
*p = 0;
return strdup(buf);
}
{
struct stat info = {0,};
- if (stat(path, &info) == 0)
+ if (stat(path, &info) == 0) {
return 1;
- else
+ } else {
return 0;
+ }
}
Eina_Bool mf_is_dir(const char *path)
DIR *dirp = NULL;
dirp = opendir(path);
- if (!dirp)
+ if (!dirp) {
return -1;
+ }
while ((readdir_r(dirp, &ent_struct, &dp) == 0) && dp) {
- if (stat(dp->d_name, &info) == 0 && (strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
- {
- closedir(dirp);
- return 0;
- }
+ if (stat(dp->d_name, &info) == 0 && (strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, ".."))) {
+ closedir(dirp);
+ return 0;
+ }
}
closedir(dirp);
return 1;
int mf_mkdir(const char *dir)
{
- if (mkdir(dir, default_mode) < 0)
+ if (mkdir(dir, default_mode) < 0) {
return 0;
- else
+ } else {
return 1;
+ }
}
static int
mf_mkpath_if_not_exists(const char *path)
{
struct stat st = {0,};
- if (stat(path, &st) < 0)
+ if (stat(path, &st) < 0) {
return mf_mkdir(path);
- else if (!S_ISDIR(st.st_mode))
+ } else if (!S_ISDIR(st.st_mode)) {
return 0;
- else
+ } else {
return 1;
+ }
}
int mf_mkpath(const char *path)
char ss[PATH_MAX] = {0,};
unsigned int i = 0;
- if (mf_is_dir(path))
+ if (mf_is_dir(path)) {
return 1;
+ }
for (i = 0; path[i] != '\0'; ss[i] = path[i], i++) {
- if (i == sizeof(ss) - 1)
+ if (i == sizeof(ss) - 1) {
return 0;
+ }
if ((path[i] == '/') && (i > 0)) {
ss[i] = '\0';
- if (!mf_mkpath_if_not_exists(ss))
+ if (!mf_mkpath_if_not_exists(ss)) {
return 0;
+ }
}
}
ss[i] = '\0';
return file;
}
-int mf_file_unlink (const char *filename)
+int mf_file_unlink(const char *filename)
{
int status = unlink(filename);
- if (status < 0)
+ if (status < 0) {
return 0;
- else
+ } else {
return 1;
+ }
}
int mf_file_size(const char *filename)
{
struct stat info = {0,};
if (stat(filename, &info) == 0) {
- if (!S_ISDIR(info.st_mode))
+ if (!S_ISDIR(info.st_mode)) {
return info.st_size;
+ }
}
return 0;
int mf_file_rmdir(const char *filename)
{
int status = rmdir(filename);
- if (status < 0)
+ if (status < 0) {
return 0;
- else
+ } else {
return 1;
+ }
}
Eina_List *mf_file_ls(const char *dir)
Eina_List *list = NULL;
dirp = opendir(dir);
- if (!dirp)
+ if (!dirp) {
return NULL;
+ }
while ((readdir_r(dirp, &ent_struct, &dp) == 0) && dp) {
if ((strcmp(dp->d_name , ".")) && (strcmp(dp->d_name , ".."))) {
if (dirp) {
while ((readdir_r(dirp, &ent_struct, &dp) == 0) && dp) {
if ((strcmp(dp->d_name , ".")) && (strcmp(dp->d_name, ".."))) {
- if (!mf_file_recursive_rm(dp->d_name))
+ if (!mf_file_recursive_rm(dp->d_name)) {
ret = 0;
+ }
}
}
closedir(dirp);
}
- if (!mf_file_rmdir(dir))
+ if (!mf_file_rmdir(dir)) {
ret = 0;
+ }
return ret;
} else {
}
}
-int mf_file_cp(const char *src,const char *dst)
+int mf_file_cp(const char *src, const char *dst)
{
FILE *f1 = NULL;
FILE *f2 = NULL;
size_t num;
int ret = 1;
- if (!realpath(src, realpath1))
+ if (!realpath(src, realpath1)) {
return 0;
+ }
- if (realpath(dst, realpath2) && !strcmp(realpath1, realpath2))
+ if (realpath(dst, realpath2) && !strcmp(realpath1, realpath2)) {
return 0;
+ }
f1 = fopen(src, "rb");
- if (!f1)
+ if (!f1) {
return 0;
+ }
f2 = fopen(dst, "wb");
if (!f2) {
}
while ((num = fread(buf, 1, sizeof(buf), f1)) > 0) {
- if (fwrite(buf, 1, num, f2) != num)
+ if (fwrite(buf, 1, num, f2) != num) {
ret = 0;
+ }
}
fclose(f1);
int mf_file_mv(const char *src, const char *dst)
{
struct stat info = {0,};
- if (stat(dst, &info) == 0)
+ if (stat(dst, &info) == 0) {
return 0;
+ }
if (rename(src, dst)) {
memset(&info, 0x00, sizeof(struct stat));
if (stat(src, &info) == 0) {
if (S_ISREG(info.st_mode)) {
- mf_file_cp(src, dst);
+ mf_file_cp(src, dst);
if (chmod(dst, info.st_mode) < 0) {
mf_debug("failed to set attributes");
}
int mf_remove(const char *filename)
{
int status = remove(filename);
- if (status < 0)
+ if (status < 0) {
return 0;
- else
+ } else {
return 1;
+ }
}
#define MF_PATH_INFO_LEN_THRESHOLD 4
#define MF_PATH_INFO_SEP elm_entry_utf8_to_markup("/")
typedef struct {
- int len_orig;
- int len_trans;
- char *original;
- char *transfer;
- bool flag_trans;
+ int len_orig;
+ int len_trans;
+ char *original;
+ char *transfer;
+ bool flag_trans;
} pNode;
-static int __mf_fm_svc_wrapper_get_unique_name(const char *default_dir_full_path, char *original_file_name,
- char **unique_file_name, int file_name_type, void *data);
+static int __mf_fm_svc_wrapper_get_unique_name(const char *default_dir_full_path, char *original_file_name,
+ char **unique_file_name, int file_name_type, void *data);
/*********************
**Function name: __mf_fm_svc_wrapper_COMESFROM
**Parameter:
}
GString *from_parent = mf_fm_svc_wrapper_get_file_parent_path(from);
- if (from_parent == NULL) {
- return ret;
- }
+ if (from_parent == NULL) {
+ return ret;
+ }
GString *to_parent = mf_fm_svc_wrapper_get_file_parent_path(to);
- if (to_parent == NULL) {
- SAFE_FREE_GSTRING(from_parent);
- return ret;
- }
+ if (to_parent == NULL) {
+ SAFE_FREE_GSTRING(from_parent);
+ return ret;
+ }
if (strncmp(from->str, to_parent->str, lensrc) == 0) {
SAFE_FREE_GSTRING(from_parent);
SAFE_FREE_GSTRING(to_parent);
char *mf_fm_svc_wrapper_get_root_path_by_location(int location)
{
- if (location == MYFILE_PHONE)
+ if (location == MYFILE_PHONE) {
return g_strdup(PHONE_FOLDER);
- else if (location == MYFILE_MMC)
+ } else if (location == MYFILE_MMC) {
return g_strdup(MEMORY_FOLDER);
- else
+ } else {
return NULL;
+ }
}
/*********************
int mf_fm_svc_wrapper_file_auto_rename(void *data, GString *fullpath, int file_name_type, GString **filename)
{
struct appdata *ap = (struct appdata *)data;
- if (ap == NULL)
+ if (ap == NULL) {
mf_debug("appdata is NULL");
+ }
assert(ap);
GString *parent_path = mf_fm_svc_wrapper_get_file_parent_path(fullpath);
Eina_List *l = NULL;
EINA_LIST_FOREACH(dir_list, l, pNode) {
- if (pNode) {
- char *real_name = NULL;
- bool result = false;
- GString *foldername = NULL;
- real_name = g_strconcat(pNode->path, "/", pNode->name, NULL);
-
- if (real_name) {
- foldername = g_string_new(real_name);
- SAFE_FREE_CHAR(real_name);
- } else {
- continue;
- }
- int error_code = mf_fm_svc_wrapper_get_folder_foldersystem(foldername, &result);
-
- if (error_code == 0 && result == true) {
- mf_debug("in default");
- *default_dir_list = eina_list_append(*default_dir_list, pNode);
- } else {
- mf_debug("in else");
- *user_dir_list = eina_list_append(*user_dir_list, pNode);
- }
- }
+ if (pNode) {
+ char *real_name = NULL;
+ bool result = false;
+ GString *foldername = NULL;
+ real_name = g_strconcat(pNode->path, "/", pNode->name, NULL);
+
+ if (real_name) {
+ foldername = g_string_new(real_name);
+ SAFE_FREE_CHAR(real_name);
+ } else {
+ continue;
+ }
+ int error_code = mf_fm_svc_wrapper_get_folder_foldersystem(foldername, &result);
+
+ if (error_code == 0 && result == true) {
+ mf_debug("in default");
+ *default_dir_list = eina_list_append(*default_dir_list, pNode);
+ } else {
+ mf_debug("in else");
+ *user_dir_list = eina_list_append(*user_dir_list, pNode);
+ }
+ }
}
return error_code;
}
struct statvfs info;
char *path = NULL;
- if (state == MYFILE_PHONE) {
- if (storage_get_internal_memory_size(&info) < 0)
+ if (state == MYFILE_PHONE) {
+ if (storage_get_internal_memory_size(&info) < 0) {
return 0;
+ }
} else if (state == MYFILE_MMC) {
path = MEMORY_FOLDER;
if (-1 == statvfs(path, &info)) {
return 0;
}
- }
- else {
+ } else {
return 0;
}
mf_retvm_if(string == NULL, g_strdup(MF_PATH_INFO_TRANS_OMIT), "input path is NULL");
char *retrench = NULL;
char *utf8_string = elm_entry_utf8_to_markup(string);
- if (utf8_string && strlen (string) > MF_PATH_INFO_LEN_THRESHOLD) {
+ if (utf8_string && strlen(string) > MF_PATH_INFO_LEN_THRESHOLD) {
if (g_utf8_strlen(utf8_string, -1) > 2) {
retrench = calloc(1, MF_PATH_INFO_RETRENCH);
if (retrench) {
params = result;
count = g_strv_length(result);
- if (count > MF_PATH_INFO_LEVEL_BOUNDARY)
- {
+ if (count > MF_PATH_INFO_LEVEL_BOUNDARY) {
top = MF_PATH_INFO_LEVEL_BOUNDARY;
flag = FALSE;
max_len = path_info_max_len - MF_PATH_INFO_LEVEL_BOUNDARY - MF_PATH_INFO_HEAD_LEN(omit);//(2 is length of ..) ../aa../bb../***
- }
- else
- {
+ } else {
top = count;
flag = TRUE;
- max_len = path_info_max_len - (count-1);
+ max_len = path_info_max_len - (count - 1);
}
for (i = top; i > 1; i--) {
pNode *nodeB = calloc(sizeof(pNode), 1);
if (nodeB) {
- nodeB->original = elm_entry_utf8_to_markup(params[count -i]);
+ nodeB->original = elm_entry_utf8_to_markup(params[count - i]);
nodeB->len_orig = strlen(params[count - i]);
- nodeB->transfer = mf_fm_svc_path_info_retrench(params[count-i]);
- if (nodeB->transfer)
+ nodeB->transfer = mf_fm_svc_path_info_retrench(params[count - i]);
+ if (nodeB->transfer) {
nodeB->len_trans = strlen(nodeB->transfer);
- else
+ } else {
mf_error("nodeB->transfer is NULL");
+ }
nodeB->flag_trans = FALSE;
total_len += nodeB->len_orig;
}
}
- if (total_len <= max_len)
- break;
+ if (total_len <= max_len) {
+ break;
+ }
}
}
char *temp = NULL;
char *sep = MF_PATH_INFO_SEP;
- EINA_LIST_FOREACH(temp_list, l, pnode)
- {
- if (pnode) {
- pNode *node = (pNode *)pnode;
- temp = output;
- if (node->flag_trans == TRUE) {
- if (output != NULL)
- output = g_strconcat(output, sep, node->transfer, NULL);
- else
- output = g_strdup(node->transfer);
- } else {
- if (output != NULL)
- output = g_strconcat(output, sep ,node->original, NULL);
- else
- output = g_strdup(node->original);
- }
- SAFE_FREE_CHAR(temp);
- }
+ EINA_LIST_FOREACH(temp_list, l, pnode) {
+ if (pnode) {
+ pNode *node = (pNode *)pnode;
+ temp = output;
+ if (node->flag_trans == TRUE) {
+ if (output != NULL) {
+ output = g_strconcat(output, sep, node->transfer, NULL);
+ } else {
+ output = g_strdup(node->transfer);
+ }
+ } else {
+ if (output != NULL) {
+ output = g_strconcat(output, sep , node->original, NULL);
+ } else {
+ output = g_strdup(node->original);
+ }
+ }
+ SAFE_FREE_CHAR(temp);
+ }
}
temp = output;
char *last_string = params[count - 1];
const char *end = NULL;
gboolean ret = FALSE;
- if (utf8_last != NULL)
+ if (utf8_last != NULL) {
ret = g_utf8_validate(utf8_last, d_value, &end);
- else
+ } else {
mf_error("utf8_last is NULL");
+ }
if (ret == TRUE) {
d_value = last_len - strlen(end);
utf8_last[d_value] = '\0';
** get the unique name of the file name
*********************/
static int __mf_fm_svc_wrapper_get_unique_name(const char *default_dir_full_path, char *original_file_name, char **unique_file_name,
- int file_name_type, void *data)
+ int file_name_type, void *data)
{
//mf_debug("%s %d\n", __func__, __LINE__);
assert(unique_file_name);
}
if (bExt == 0) {
- if (file_name_type == FILE_NAME_WITH_BRACKETS)
+ if (file_name_type == FILE_NAME_WITH_BRACKETS) {
new_file_name = g_strdup_printf("%s(%d).%s", file_name_without_ext, nCount, file_ext);
- else
- new_file_name = g_strdup_printf("%s_%d.%s", file_name_without_ext, nCount, file_ext);
} else {
+ new_file_name = g_strdup_printf("%s_%d.%s", file_name_without_ext, nCount, file_ext);
+ }
+ } else {
- if (file_name_type == FILE_NAME_WITH_BRACKETS)
+ if (file_name_type == FILE_NAME_WITH_BRACKETS) {
new_file_name = g_strdup_printf("%s(%d)", file_name_without_ext, nCount);
- else
+ } else {
new_file_name = g_strdup_printf("%s_%d", file_name_without_ext, nCount);
+ }
}
- //mf_debug("new_file_name [%s]", new_file_name);
- //mf_debug("original_file_name [%s]", new_file_name);
+ //mf_debug("new_file_name [%s]", new_file_name);
+ //mf_debug("original_file_name [%s]", new_file_name);
SAFE_FREE_CHAR(file_name_without_ext);
#ifdef MYFILE_CHECK_DIR_FILE_PATH_MAXIMUM_LENGTH
if (mf_util_character_count_get(new_file_name) > MYFILE_FILE_NAME_LEN_MAX ||
- mf_util_character_count_get(dir_rel_path) + slash + mf_util_charactor_count_get(new_file_name) > MYFILE_FILE_PATH_LEN_MAX) {
+ mf_util_character_count_get(dir_rel_path) + slash + mf_util_charactor_count_get(new_file_name) > MYFILE_FILE_PATH_LEN_MAX) {
SECURE_DEBUG("......(%s/%s) exceeds maximum length: %d...", dir_rel_path, new_file_name, MYFILE_FILE_PATH_LEN_MAX);
error_code = MYFILE_ERR_EXCEED_MAX_LENGTH;
goto Exception;
#endif
SECURE_DEBUG("new name is %s\n", new_file_name);
//prevent issue fix
- /* if (error_code != 0) {
- original_file_name = g_strdup(new_file_name);
- error_code = MYFILE_ERR_DUPLICATED_NAME;
- SAFE_FREE_CHAR(new_file_name);
- SAFE_FREE_CHAR(file_ext);
- continue;
- } else*/
+ /* if (error_code != 0) {
+ original_file_name = g_strdup(new_file_name);
+ error_code = MYFILE_ERR_DUPLICATED_NAME;
+ SAFE_FREE_CHAR(new_file_name);
+ SAFE_FREE_CHAR(file_ext);
+ continue;
+ } else*/
{
error_code = mf_file_attr_is_duplicated_name(default_dir_full_path, new_file_name);
if (error_code == 0) {
case MF_TRANS_OPTION_POPUP:
if (strlen(original_path) > MF_TRANSLATE_LENGTH) {
new_path =
- g_strconcat(mf_util_get_text(MF_LABEL_DEVICE_MEMORY), MF_TRANSLATE_OMIT_PART, mf_file_get(original_path), "/",
- NULL);
+ g_strconcat(mf_util_get_text(MF_LABEL_DEVICE_MEMORY), MF_TRANSLATE_OMIT_PART, mf_file_get(original_path), "/",
+ NULL);
} else {
root_len = strlen(PHONE_FOLDER);
new_path = g_strconcat(mf_util_get_text(MF_LABEL_DEVICE_MEMORY), original_path + root_len, "/", NULL);
case MF_TRANS_OPTION_POPUP:
if (strlen(original_path) > MF_TRANSLATE_LENGTH) {
new_path =
- g_strconcat(mf_util_get_text(MF_LABEL_SD_CARD), MF_TRANSLATE_OMIT_PART, mf_file_get(original_path),
- NULL);
+ g_strconcat(mf_util_get_text(MF_LABEL_SD_CARD), MF_TRANSLATE_OMIT_PART, mf_file_get(original_path),
+ NULL);
} else {
root_len = strlen(MEMORY_FOLDER);
new_path = g_strconcat(mf_util_get_text(MF_LABEL_SD_CARD), original_path + root_len, "/", NULL);
default:
return NULL;
}
- current_path = current_path+strlen(root_path)+1;
+ current_path = current_path + strlen(root_path) + 1;
path_list = eina_list_append(path_list, g_strdup(root_path));
gchar **result = NULL;
gchar **params = NULL;
}
path_list = eina_list_append(path_list, level_path);
}
-
+
g_strfreev(result);
-
- }else {
+
+ } else {
path_list = eina_list_append(path_list, g_strdup(original_path));
}
}
filename = mf_fm_svc_wrapper_get_file_name(path);
if (filename != NULL) {
- guide_text = mf_fm_svc_get_file_name_without_ext(filename->str);
- SAFE_FREE_GSTRING(filename);
+ guide_text = mf_fm_svc_get_file_name_without_ext(filename->str);
+ SAFE_FREE_GSTRING(filename);
}
return guide_text;
}
}
if (!mf_mkpath(fullpath)) {
error_code = MYFILE_ERR_DIR_CREATE_FAIL;
- goto EXIT;
+ goto EXIT;
}
EXIT:
SAFE_FREE_CHAR(ap->mf_Status.EnterFrom);
ap->mf_Status.EnterFrom = mf_genlist_first_item_name_get(ap->mf_MainWindow.pNaviGenlist);
}
- if (ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_EDIT_DETAIL
- ) {
+ if (ap->mf_Status.more == MORE_EDIT
+ || ap->mf_Status.more == MORE_SHARE_EDIT
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_EDIT_DETAIL
+ ) {
pre_more = ap->mf_Status.more;
ap->mf_Status.more = MORE_DEFAULT;
folder_list = mf_edit_get_selected_folder_list();
}
mf_object_box_clear(ap->mf_MainWindow.pNaviBox);
mf_view_update(ap);
- if (pre_more == MORE_EDIT
- || pre_more == MORE_SHARE_EDIT
- || pre_more == MORE_EDIT_COPY
- || pre_more == MORE_EDIT_MOVE
- || pre_more == MORE_EDIT_DELETE
- || pre_more == MORE_EDIT_DETAIL
- ) {
+ if (pre_more == MORE_EDIT
+ || pre_more == MORE_SHARE_EDIT
+ || pre_more == MORE_EDIT_COPY
+ || pre_more == MORE_EDIT_MOVE
+ || pre_more == MORE_EDIT_DELETE
+ || pre_more == MORE_EDIT_DETAIL
+ ) {
ap->mf_Status.more = pre_more;
mf_edit_view_refresh(ap, &file_list, &folder_list);
}
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "appdata is NULL");
if (!(ap->mf_Status.more == MORE_DEFAULT
- || ap->mf_Status.more == MORE_INTERNAL_COPY
- || ap->mf_Status.more == MORE_INTERNAL_MOVE
- || ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_THUMBNAIL_RENAME
- || ap->mf_Status.more == MORE_EDIT_DETAIL)) {
+ || ap->mf_Status.more == MORE_INTERNAL_COPY
+ || ap->mf_Status.more == MORE_INTERNAL_MOVE
+ || ap->mf_Status.more == MORE_EDIT
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_THUMBNAIL_RENAME
+ || ap->mf_Status.more == MORE_EDIT_DETAIL)) {
return;
}
if (ap->mf_Status.view_type == mf_view_root || ap->mf_Status.view_type == mf_view_root_category || ap->mf_Status.view_type == mf_view_storage) {
fs_monitor_update_timer = ecore_timer_add(1, (Ecore_Task_Cb)__mf_fs_monitor_dir_pipe_add_cb, ap);
SAFE_FREE_CHAR(fs_monitor_update_item_name);
}
- if (msg->name)
+ if (msg->name) {
free(msg->name);
+ }
mf_inotify_handle_request_handled_send();
}
}
SAFE_FREE_CHAR(fs_monitor_dir_path);
SAFE_FREE_CHAR(fs_monitor_update_item_name);
-
+
SAFE_DEL_ECORE_TIMER(fs_monitor_update_timer);
monitor_refresh_start_flag = EINA_FALSE;
fs_monitor_dir_path = g_strdup(path);
if (fs_monitor_pipe) {
ecore_pipe_del(fs_monitor_pipe);
}
-
+
SAFE_DEL_ECORE_TIMER(fs_monitor_update_timer);
monitor_refresh_start_flag = EINA_FALSE;
mf_inotify_event s_event = MF_INOTI_NONE;
SECURE_DEBUG("mask=%x dir=%s len=%d name=%s",
- pevent->mask, (pevent->mask & IN_ISDIR) ? "yes" : "no", pevent->len, (pevent->len) ? pevent->name : NULL);
+ pevent->mask, (pevent->mask & IN_ISDIR) ? "yes" : "no", pevent->len, (pevent->len) ? pevent->name : NULL);
if (pevent->len && strncmp(pevent->name, ".", 1) == 0) {
s_event = MF_INOTI_NONE;
} else if (pevent->mask & IN_ISDIR) {
- if (pevent->mask & IN_DELETE_SELF)
+ if (pevent->mask & IN_DELETE_SELF) {
s_event = MF_INOTI_DELETE_SELF;
+ }
- if (pevent->mask & IN_MOVE_SELF)
+ if (pevent->mask & IN_MOVE_SELF) {
s_event = MF_INOTI_MOVE_SELF;
+ }
- if (pevent->mask & IN_CREATE)
+ if (pevent->mask & IN_CREATE) {
s_event = MF_INOTI_CREATE;
+ }
- if (pevent->mask & IN_DELETE)
+ if (pevent->mask & IN_DELETE) {
s_event = MF_INOTI_DELETE;
+ }
- if (pevent->mask & IN_MOVED_FROM)
+ if (pevent->mask & IN_MOVED_FROM) {
s_event = MF_INOTI_MOVE_OUT;
+ }
- if (pevent->mask & IN_MOVED_TO)
+ if (pevent->mask & IN_MOVED_TO) {
s_event = MF_INOTI_MOVE_IN;
+ }
} else {
if (pevent->mask & IN_CREATE) {
s_event = MF_INOTI_NONE;
handle->prev_event = 0;
}
- if (pevent->mask & IN_DELETE)
+ if (pevent->mask & IN_DELETE) {
s_event = MF_INOTI_DELETE;
+ }
- if (pevent->mask & IN_MOVED_FROM)
+ if (pevent->mask & IN_MOVED_FROM) {
s_event = MF_INOTI_MOVE_OUT;
+ }
- if (pevent->mask & IN_MOVED_TO)
+ if (pevent->mask & IN_MOVED_TO) {
s_event = MF_INOTI_MOVE_IN;
+ }
}
mf_debug("s_event : %d, prev_event: %x, callback : %p", s_event, handle->prev_event, handle->callback);
Eina_List *l = NULL;
char *first_file = NULL;
GString *fullpath = NULL;
- EINA_LIST_FOREACH(selected_list, l, fullpath) {
- if (fullpath != NULL) {
- if (first_file == NULL && selected_files->multi_files == NULL) {
- first_file = g_strdup(fullpath->str);
- } else {
- if (selected_files->multi_files == NULL) {
- selected_files->multi_files = calloc(eina_list_count(selected_list), sizeof(char *));
- if (selected_files->multi_files) {
- selected_files->multi_files[0] = g_strdup(first_file);
- SAFE_FREE_CHAR(first_file);
- selected_files->multi_files[file_count] = g_strdup(fullpath->str);
- }
- } else {
+ EINA_LIST_FOREACH(selected_list, l, fullpath) {
+ if (fullpath != NULL) {
+ if (first_file == NULL && selected_files->multi_files == NULL) {
+ first_file = g_strdup(fullpath->str);
+ } else {
+ if (selected_files->multi_files == NULL) {
+ selected_files->multi_files = calloc(eina_list_count(selected_list), sizeof(char *));
+ if (selected_files->multi_files) {
+ selected_files->multi_files[0] = g_strdup(first_file);
+ SAFE_FREE_CHAR(first_file);
selected_files->multi_files[file_count] = g_strdup(fullpath->str);
}
+ } else {
+ selected_files->multi_files[file_count] = g_strdup(fullpath->str);
}
- file_count++;
}
+ file_count++;
}
+ }
if (first_file) {
selected_files->single_file = first_file;
mf_error(" app_control_create failed");
return ;
}
- mf_error("item_data->m_ItemName->str is %s",item_data->m_ItemName->str);
+ mf_error("item_data->m_ItemName->str is %s", item_data->m_ItemName->str);
char prefix_file[BUFF_SIZE] = {0,};
snprintf(prefix_file, BUFF_SIZE, "%s%s", MF_SHARE_FILE_PREFIX, item_data->m_ItemName->str);
}
//app_control_add_extra_data_array(handle, MF_SHARE_SVC_FILE_PATH, &item_data->m_ItemName->str, 1);
app_control_add_extra_data(handle, MF_SHARE_SVC_FILE_PATH, item_data->m_ItemName->str);
-/*
- ret = app_control_set_window(handle, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
- if (ret != APP_CONTROL_ERROR_NONE) {
- app_control_destroy(handle);
- mf_debug("app_control_set_window()... [0x%x]", ret);
- return;
- }
-*/
+ /*
+ ret = app_control_set_window(handle, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ app_control_destroy(handle);
+ mf_debug("app_control_set_window()... [0x%x]", ret);
+ return;
+ }
+ */
ret = app_control_send_launch_request(handle, NULL, NULL);
if (ret == APP_CONTROL_ERROR_APP_NOT_FOUND) {
mf_popup_create_popup(ap, POPMODE_TEXT, NULL, MF_LABEL_NO_APP, NULL, NULL, NULL, NULL, NULL);
mf_info("pLongpressPopup is deleted");
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
//other files will share directly
- mf_launch_item_share_file(data,obj,event_info);
+ mf_launch_item_share_file(data, obj, event_info);
MF_TRACE_END;
}
} else {
goto END;
}
-/*
- ret = app_control_set_window(handle, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
- if (ret != APP_CONTROL_ERROR_NONE) {
- mf_debug("app_control_set_window()... [0x%x]", ret);
- goto END;
- }
-*/
+ /*
+ ret = app_control_set_window(handle, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ mf_debug("app_control_set_window()... [0x%x]", ret);
+ goto END;
+ }
+ */
ret = app_control_set_launch_mode(handle, APP_CONTROL_LAUNCH_MODE_GROUP);
if (ret != APP_CONTROL_ERROR_NONE) {
mf_debug("app_control_set_operation()... [0x%x]", ret);
goto END;
}
-/*
- ret = app_control_set_window(app_control, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
- if (ret != APP_CONTROL_ERROR_NONE) {
- mf_debug("app_control_set_uri()... [0x%x]", ret);
- goto END;
- }
-*/
+ /*
+ ret = app_control_set_window(app_control, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ mf_debug("app_control_set_uri()... [0x%x]", ret);
+ goto END;
+ }
+ */
ret = app_control_set_app_id(app_control, STORAGE_UG_NAME);
if (ret != APP_CONTROL_ERROR_NONE) {
mf_debug("app_control_set_uri()... [0x%x]", ret);
if (list) {
int index = 0;
int list_len = eina_list_count(list);
- for (; (list_len-index) >= RECENT_FILES_COUNT_MAX; index++) {
+ for (; (list_len - index) >= RECENT_FILES_COUNT_MAX; index++) {
char *cross_path = eina_list_nth(list, index);
mf_media_delete_recent_files(ap->mf_MainWindow.mfd_handle, cross_path);
}
app_control_add_extra_data(app_control, "file_type", ap->mf_Bundle.file_type);
app_control_add_extra_data(app_control, "marked_mode", ap->mf_Bundle.marked_mode);
//ug = ug_create(NULL, MYFILE_UG_NAME, UG_MODE_FULLVIEW, service, &cbs);
-/*
- ret = app_control_set_window(app_control, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
- mf_retm_if(ret != APP_CONTROL_ERROR_NONE, "service create failed");
-*/
+ /*
+ ret = app_control_set_window(app_control, elm_win_xwindow_get(ap->mf_MainWindow.pWindow));
+ mf_retm_if(ret != APP_CONTROL_ERROR_NONE, "service create failed");
+ */
ret = app_control_set_app_id(app_control, MYFILE_UG_NAME);
if (ret != APP_CONTROL_ERROR_NONE) {
app_control_destroy(app_control);
app_control_add_extra_data(app_control, "Path", path);
app_control_set_launch_mode(app_control, APP_CONTROL_LAUNCH_MODE_GROUP);
} else if (category == FILE_TYPE_SOUND
- || category == FILE_TYPE_MUSIC
- || category == FILE_TYPE_VOICE) {
+ || category == FILE_TYPE_MUSIC
+ || category == FILE_TYPE_VOICE) {
mf_debug("category is sound");
app_control_add_extra_data(app_control, "View By", "By Folder");
if (sort_type == MYFILE_SORT_BY_NAME_A2Z) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_NAME_A2Z");
- } else if(sort_type == MYFILE_SORT_BY_SIZE_S2L) {
+ } else if (sort_type == MYFILE_SORT_BY_SIZE_S2L) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_SIZE_S2L");
- } else if(sort_type == MYFILE_SORT_BY_DATE_O2R) {
+ } else if (sort_type == MYFILE_SORT_BY_DATE_O2R) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_DATE_O2R");
- } else if(sort_type == MYFILE_SORT_BY_TYPE_A2Z) {
+ } else if (sort_type == MYFILE_SORT_BY_TYPE_A2Z) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_TYPE_A2Z");
- } else if(sort_type == MYFILE_SORT_BY_NAME_Z2A) {
+ } else if (sort_type == MYFILE_SORT_BY_NAME_Z2A) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_NAME_Z2A");
- } else if(sort_type == MYFILE_SORT_BY_SIZE_L2S) {
+ } else if (sort_type == MYFILE_SORT_BY_SIZE_L2S) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_SIZE_L2S");
- } else if(sort_type == MYFILE_SORT_BY_DATE_R2O) {
+ } else if (sort_type == MYFILE_SORT_BY_DATE_R2O) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_DATE_R2O");
- } else if(sort_type == MYFILE_SORT_BY_TYPE_Z2A) {
+ } else if (sort_type == MYFILE_SORT_BY_TYPE_Z2A) {
app_control_add_extra_data(app_control, "sort_type", "MYFILE_SORT_BY_TYPE_Z2A");
}
if (ap->mf_Status.view_type != mf_view_root_category) {
ap->mf_Status.launch_path = g_strdup(path);
mf_debug("app_control_send_launch_request()... [0x%x]", ret);
/*reflesh recent files list in root view */
- mf_info("ap->mf_Status.view_type is %d, ap->mf_Status.flag_tab is %d",ap->mf_Status.view_type,ap->mf_Status.flag_tab);
+ mf_info("ap->mf_Status.view_type is %d, ap->mf_Status.flag_tab is %d", ap->mf_Status.view_type, ap->mf_Status.flag_tab);
if (ap->mf_Status.view_type == mf_view_root && ap->mf_Status.flag_tab == MF_TAB_RIGHT && ap->mf_Status.more == MORE_DEFAULT) {
//__mf_root_view_recent_files_content_create(ap);
}
int mf_log_record(char *filename, const char *function, int line, char *fmt, ...)
{
- if (g_fp == NULL)
+ if (g_fp == NULL) {
return MYFILE_ERR_INVALID_ARG;
+ }
char *message = NULL;
va_list arg_ptr;
}
if (condition->cond) {
ret = media_filter_set_condition(tmp_filter, condition->cond,
- condition->collate_type);
+ condition->collate_type);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
mf_debug("Fail to set condition");
goto ERROR;
*/
*filter = tmp_filter;
return ret;
- ERROR:
- if (tmp_filter) {
+ERROR:
+ if (tmp_filter) {
media_filter_destroy(tmp_filter);
tmp_filter = NULL;
}
return count;
}
-int mf_media_content_data_get(void *data, char *condition, bool (*func) (media_info_h media, void *data))
+int mf_media_content_data_get(void *data, char *condition, bool (*func)(media_info_h media, void *data))
{
filter_h filter = NULL;
int ret = -1;
}
ret = media_info_foreach_media_from_db(filter,
- (media_info_cb)func,
- data);
+ (media_info_cb)func,
+ data);
if (ret != 0) {
mf_debug("Fail to parse folders in db: %d", ret);
}
void mf_media_data_item_free(media_data_s **item_data)
{
- if (*item_data == NULL)
+ if (*item_data == NULL) {
return;
-
+ }
+
SAFE_FREE_CHAR((*item_data)->fullpath);
SAFE_FREE_CHAR((*item_data)->display_name);
SAFE_FREE_CHAR((*item_data)->thumbnail_path);
}
- if (content_type == MEDIA_CONTENT_TYPE_IMAGE) /* The device's internal storage */
+ if (content_type == MEDIA_CONTENT_TYPE_IMAGE) { /* The device's internal storage */
item_data->file_type = FILE_TYPE_IMAGE;
- else if (content_type == MEDIA_CONTENT_TYPE_VIDEO) /* The device's external storage */
+ } else if (content_type == MEDIA_CONTENT_TYPE_VIDEO) { /* The device's external storage */
item_data->file_type = FILE_TYPE_VIDEO;
- else if (content_type == MEDIA_CONTENT_TYPE_SOUND)
+ } else if (content_type == MEDIA_CONTENT_TYPE_SOUND) {
item_data->file_type = FILE_TYPE_SOUND;
- else if (content_type == MEDIA_CONTENT_TYPE_MUSIC) /* The cloud storage - 101 */
+ } else if (content_type == MEDIA_CONTENT_TYPE_MUSIC) { /* The cloud storage - 101 */
item_data->file_type = FILE_TYPE_MUSIC;
- else if (content_type == MEDIA_CONTENT_TYPE_OTHERS) {
+ } else if (content_type == MEDIA_CONTENT_TYPE_OTHERS) {
fsFileType ftype = FILE_TYPE_NONE;
int ret = mf_file_attr_get_file_category(item_data->fullpath, &ftype);
if (ret != MYFILE_ERR_NONE || ftype == FILE_TYPE_NONE || ftype == FILE_TYPE_ETC) {
}
item_data->file_type = ftype;
- }
- else {
+ } else {
mf_debug("content_type[%d]!", content_type);
}
switch (item_data->file_type) {
- case FILE_TYPE_IMAGE:
- case FILE_TYPE_VIDEO:
- case FILE_TYPE_MUSIC:
- case FILE_TYPE_SOUND:
- case FILE_TYPE_DOC:
- case FILE_TYPE_PDF:
- case FILE_TYPE_PPT:
- case FILE_TYPE_EXCEL:
- case FILE_TYPE_TXT:
- case FILE_TYPE_HWP:
- case FILE_TYPE_SPD:
- case FILE_TYPE_SNB:
- if (mf_file_exists(item_data->fullpath)) {//Fixed the P131126-04292, sometimes, if the file isn't existed
- //if (content_type != MEDIA_CONTENT_TYPE_SOUND && content_type != MEDIA_CONTENT_TYPE_MUSIC) {//For sound file, don't need to get thumbnail.
- int retcode = media_info_get_thumbnail_path(media, &(item_data->thumbnail_path));
- if (retcode != MEDIA_CONTENT_ERROR_NONE) {
- mf_debug("Get media thumbnail path failed!![%d]", retcode);
- goto MF_LOCAL_FAILED;
- }
- //}
- //mf_debug("thumb_url: %s", item_data->thumbnail_path);
-
- media_content_storage_e storage_type = 0;
- if (media_info_get_storage_type(media, &storage_type) != MEDIA_CONTENT_ERROR_NONE) {
- mf_debug("Get storage type failed!");
- goto MF_LOCAL_FAILED;
- }
- if (storage_type == MEDIA_CONTENT_STORAGE_INTERNAL) /* The device's internal storage */
- item_data->storage_type = MYFILE_PHONE;
- else if (storage_type == MEDIA_CONTENT_STORAGE_EXTERNAL) /* The device's external storage */
- item_data->storage_type = MYFILE_MMC;
- else
- mf_debug("Undefined mode[%d]!", storage_type);
- unsigned long long file_size = 0;
- media_info_get_size(media, &file_size);
- item_data->size = file_size;
-
- time_t added_time = {0};
- int ret = media_info_get_modified_time(media, &added_time);
- if (ret == MEDIA_CONTENT_ERROR_NONE)//Fix prevent problem
- item_data->create_date = added_time;
-
- return item_data;
- } else{
- mf_media_data_item_free(&item_data);
+ case FILE_TYPE_IMAGE:
+ case FILE_TYPE_VIDEO:
+ case FILE_TYPE_MUSIC:
+ case FILE_TYPE_SOUND:
+ case FILE_TYPE_DOC:
+ case FILE_TYPE_PDF:
+ case FILE_TYPE_PPT:
+ case FILE_TYPE_EXCEL:
+ case FILE_TYPE_TXT:
+ case FILE_TYPE_HWP:
+ case FILE_TYPE_SPD:
+ case FILE_TYPE_SNB:
+ if (mf_file_exists(item_data->fullpath)) {//Fixed the P131126-04292, sometimes, if the file isn't existed
+ //if (content_type != MEDIA_CONTENT_TYPE_SOUND && content_type != MEDIA_CONTENT_TYPE_MUSIC) {//For sound file, don't need to get thumbnail.
+ int retcode = media_info_get_thumbnail_path(media, &(item_data->thumbnail_path));
+ if (retcode != MEDIA_CONTENT_ERROR_NONE) {
+ mf_debug("Get media thumbnail path failed!![%d]", retcode);
+ goto MF_LOCAL_FAILED;
+ }
+ //}
+ //mf_debug("thumb_url: %s", item_data->thumbnail_path);
+
+ media_content_storage_e storage_type = 0;
+ if (media_info_get_storage_type(media, &storage_type) != MEDIA_CONTENT_ERROR_NONE) {
+ mf_debug("Get storage type failed!");
+ goto MF_LOCAL_FAILED;
+ }
+ if (storage_type == MEDIA_CONTENT_STORAGE_INTERNAL) { /* The device's internal storage */
+ item_data->storage_type = MYFILE_PHONE;
+ } else if (storage_type == MEDIA_CONTENT_STORAGE_EXTERNAL) { /* The device's external storage */
+ item_data->storage_type = MYFILE_MMC;
+ } else {
+ mf_debug("Undefined mode[%d]!", storage_type);
+ }
+ unsigned long long file_size = 0;
+ media_info_get_size(media, &file_size);
+ item_data->size = file_size;
+
+ time_t added_time = {0};
+ int ret = media_info_get_modified_time(media, &added_time);
+ if (ret == MEDIA_CONTENT_ERROR_NONE) { //Fix prevent problem
+ item_data->create_date = added_time;
}
- break;
- default:
+
+ return item_data;
+ } else {
mf_media_data_item_free(&item_data);
- break;
- }
- return NULL;
+ }
+ break;
+ default:
+ mf_media_data_item_free(&item_data);
+ break;
+ }
+ return NULL;
MF_LOCAL_FAILED:
- mf_media_data_item_free(&item_data);
- return NULL;
+ mf_media_data_item_free(&item_data);
+ return NULL;
}
mf_file_attr_get_file_category(file_path, &file_type);
//mf_error(">>>>file_path = %s, file_type=%d, FILE_TYPE_DOC=%d,FILE_TYPE_TXT=%d", file_path, file_type, FILE_TYPE_DOC,FILE_TYPE_TXT);
switch (file_type) {
- case FILE_TYPE_DOC:
- case FILE_TYPE_PDF:
- case FILE_TYPE_PPT:
- case FILE_TYPE_EXCEL:
- case FILE_TYPE_TXT:
- case FILE_TYPE_HWP:
- case FILE_TYPE_SPD:
- case FILE_TYPE_SNB:{
- //mf_error(">>>>file_type = %d", file_type);
- if (!mf_file_exists(file_path)) {
- free(file_path);
- file_path = NULL;
- return true;
- }
- if (file_path != NULL) {
- free(file_path);
- file_path = NULL;
- }
-
- media_info_get_size(media, &size);
- //mf_error(">>>>size = %d", size);
- status->total_size += size;
- break;
+ case FILE_TYPE_DOC:
+ case FILE_TYPE_PDF:
+ case FILE_TYPE_PPT:
+ case FILE_TYPE_EXCEL:
+ case FILE_TYPE_TXT:
+ case FILE_TYPE_HWP:
+ case FILE_TYPE_SPD:
+ case FILE_TYPE_SNB: {
+ //mf_error(">>>>file_type = %d", file_type);
+ if (!mf_file_exists(file_path)) {
+ free(file_path);
+ file_path = NULL;
+ return true;
}
- default:
- if (file_path != NULL) {
- free(file_path);
- file_path = NULL;
- }
- break;
+ if (file_path != NULL) {
+ free(file_path);
+ file_path = NULL;
+ }
+
+ media_info_get_size(media, &size);
+ //mf_error(">>>>size = %d", size);
+ status->total_size += size;
+ break;
+ }
+ default:
+ if (file_path != NULL) {
+ free(file_path);
+ file_path = NULL;
+ }
+ break;
}
} else {
char *file_path = NULL;
free(file_path);
return true;
}
- if (file_path != NULL)
+ if (file_path != NULL) {
free(file_path);
+ }
media_info_get_size(media, &size);
status->total_size += size;
mf_debug("update_info : %d", update_info->type);
switch (update_info->type) {
- case MF_STORAGE_IMAGE:{
- if (storage_status->update_cb)
- storage_status->update_cb(mf_tray_item_category_image, update_info, storage_status->pUserData);
+ case MF_STORAGE_IMAGE: {
+ if (storage_status->update_cb) {
+ storage_status->update_cb(mf_tray_item_category_image, update_info, storage_status->pUserData);
+ }
- storage_status->image_size_info.total_size = update_info->total_size;
- storage_status->image_size_info.type= update_info->type;
- break;
- }
- case MF_STORAGE_VIDEO:{
- if (storage_status->update_cb)
- storage_status->update_cb(mf_tray_item_category_video, update_info, storage_status->pUserData);
- storage_status->video_size_info.total_size = update_info->total_size;
- storage_status->video_size_info.type= update_info->type;
- break;
- }
- case MF_STORAGE_SOUND:{
- if (storage_status->update_cb)
- storage_status->update_cb(mf_tray_item_category_sounds, update_info, storage_status->pUserData);
- storage_status->sound_size_info.total_size = update_info->total_size;
- storage_status->sound_size_info.type= update_info->type;
- break;
- }
- case MF_STORAGE_DOCUMENT:{
- if (storage_status->update_cb)
- storage_status->update_cb(mf_tray_item_category_document, update_info, storage_status->pUserData);
- storage_status->document_size_info.total_size = update_info->total_size;
- storage_status->document_size_info.type= update_info->type;
- break;
- }
- case MF_STORAGE_RECENT:{
- /*if (storage_status->update_cb)
- storage_status->update_cb(mf_tray_item_category_recent, update_info, storage_status->pUserData);
- storage_status->recent_size_info.total_size = update_info->total_size;
- storage_status->recent_size_info.type= update_info->type;*/
- break;
- }
- default:
- mf_error("wrong update type");
- break;
+ storage_status->image_size_info.total_size = update_info->total_size;
+ storage_status->image_size_info.type = update_info->type;
+ break;
+ }
+ case MF_STORAGE_VIDEO: {
+ if (storage_status->update_cb) {
+ storage_status->update_cb(mf_tray_item_category_video, update_info, storage_status->pUserData);
+ }
+ storage_status->video_size_info.total_size = update_info->total_size;
+ storage_status->video_size_info.type = update_info->type;
+ break;
+ }
+ case MF_STORAGE_SOUND: {
+ if (storage_status->update_cb) {
+ storage_status->update_cb(mf_tray_item_category_sounds, update_info, storage_status->pUserData);
+ }
+ storage_status->sound_size_info.total_size = update_info->total_size;
+ storage_status->sound_size_info.type = update_info->type;
+ break;
+ }
+ case MF_STORAGE_DOCUMENT: {
+ if (storage_status->update_cb) {
+ storage_status->update_cb(mf_tray_item_category_document, update_info, storage_status->pUserData);
+ }
+ storage_status->document_size_info.total_size = update_info->total_size;
+ storage_status->document_size_info.type = update_info->type;
+ break;
+ }
+ case MF_STORAGE_RECENT: {
+ /*if (storage_status->update_cb)
+ storage_status->update_cb(mf_tray_item_category_recent, update_info, storage_status->pUserData);
+ storage_status->recent_size_info.total_size = update_info->total_size;
+ storage_status->recent_size_info.type= update_info->type;*/
+ break;
+ }
+ default:
+ mf_error("wrong update type");
+ break;
}
}
}
switch (type) {
- case MF_STORAGE_IMAGE:
- {
- double images_size = __mf_storage_main_picture_status_get();
- mf_debug("images_size = %f", images_size);
-
- Update_Info images_info;
- memset(&images_info, 0, sizeof(Update_Info));
- images_info.type = MF_STORAGE_IMAGE;
- images_info.total_size = images_size;
- if (storage_status->pipe)
- ecore_pipe_write(storage_status->pipe, &images_info, sizeof(images_info));
+ case MF_STORAGE_IMAGE: {
+ double images_size = __mf_storage_main_picture_status_get();
+ mf_debug("images_size = %f", images_size);
+
+ Update_Info images_info;
+ memset(&images_info, 0, sizeof(Update_Info));
+ images_info.type = MF_STORAGE_IMAGE;
+ images_info.total_size = images_size;
+ if (storage_status->pipe) {
+ ecore_pipe_write(storage_status->pipe, &images_info, sizeof(images_info));
}
- break;
- case MF_STORAGE_VIDEO:
- {
- double video_size = __mf_storage_main_video_status_get();
- mf_debug("video_size = %f", video_size);
-
- Update_Info video_info;
- memset(&video_info, 0, sizeof(Update_Info));
- video_info.type = MF_STORAGE_VIDEO;
- video_info.total_size = video_size;
- if (storage_status->pipe)
- ecore_pipe_write(storage_status->pipe, &video_info, sizeof(video_info));
+ }
+ break;
+ case MF_STORAGE_VIDEO: {
+ double video_size = __mf_storage_main_video_status_get();
+ mf_debug("video_size = %f", video_size);
+
+ Update_Info video_info;
+ memset(&video_info, 0, sizeof(Update_Info));
+ video_info.type = MF_STORAGE_VIDEO;
+ video_info.total_size = video_size;
+ if (storage_status->pipe) {
+ ecore_pipe_write(storage_status->pipe, &video_info, sizeof(video_info));
}
- break;
- case MF_STORAGE_SOUND:
- {
- double sound_size = __mf_storage_main_sound_status_get();
- mf_debug("sound_size = %f", sound_size);
-
- Update_Info sound_info;
- memset(&sound_info, 0, sizeof(Update_Info));
- sound_info.type = MF_STORAGE_SOUND;
- sound_info.total_size = sound_size;
- if (storage_status->pipe)
- ecore_pipe_write(storage_status->pipe, &sound_info, sizeof(sound_info));
+ }
+ break;
+ case MF_STORAGE_SOUND: {
+ double sound_size = __mf_storage_main_sound_status_get();
+ mf_debug("sound_size = %f", sound_size);
+
+ Update_Info sound_info;
+ memset(&sound_info, 0, sizeof(Update_Info));
+ sound_info.type = MF_STORAGE_SOUND;
+ sound_info.total_size = sound_size;
+ if (storage_status->pipe) {
+ ecore_pipe_write(storage_status->pipe, &sound_info, sizeof(sound_info));
}
- break;
- case MF_STORAGE_DOCUMENT:
- {
- double document_size = __mf_storage_main_document_status_get();
- mf_debug("document_size = %f", document_size);
-
- Update_Info document_info;
- memset(&document_info, 0, sizeof(Update_Info));
- document_info.type = MF_STORAGE_DOCUMENT;
- document_info.total_size = document_size;
- if (storage_status->pipe)
- ecore_pipe_write(storage_status->pipe, &document_info, sizeof(document_info));
+ }
+ break;
+ case MF_STORAGE_DOCUMENT: {
+ double document_size = __mf_storage_main_document_status_get();
+ mf_debug("document_size = %f", document_size);
+
+ Update_Info document_info;
+ memset(&document_info, 0, sizeof(Update_Info));
+ document_info.type = MF_STORAGE_DOCUMENT;
+ document_info.total_size = document_size;
+ if (storage_status->pipe) {
+ ecore_pipe_write(storage_status->pipe, &document_info, sizeof(document_info));
}
- break;
- case MF_STORAGE_RECENT:
- {
+ }
+ break;
+ case MF_STORAGE_RECENT: {
/*double recent_size = __mf_storage_main_recent_status_get();
mf_debug("recent_size = %f", recent_size);
recent_info.total_size = recent_size;
if (storage_status->pipe)
ecore_pipe_write(storage_status->pipe, &recent_info, sizeof(Update_Info));*/
- }
+ }
+ break;
+ default: {
+ mf_debug("type = %d", type);
break;
- default:
- {
- mf_debug("type = %d", type);
- break;
- }
+ }
}
pthread_mutex_lock(&storage_status->update_mutex);
storage_status->type++;
storage_status->pipe = NULL;
}
storage_status->pipe = ecore_pipe_add(__mf_storage_main_pipe_cb, storage_status);
- if (storage_status->pipe)
- {
+ if (storage_status->pipe) {
int ret = pthread_create(&storage_status->tid, NULL, __mf_storage_main_thread_start_routine, storage_status);
if (ret != 0) {
mf_error("fail to pthread_create");
}
mf_debug("thread id = %ld", storage_status->tid);
- }
- else
- {
+ } else {
mf_error("fail to ecore_pipe_add");
}
MF_TRACE_END;
pthread_mutex_lock(&storage_status->update_data_mutex);
storage_status->is_update_data = false;
- if (ap->mf_Status.view_type != mf_view_root || ap->mf_Status.more != MORE_DEFAULT)
+ if (ap->mf_Status.view_type != mf_view_root || ap->mf_Status.more != MORE_DEFAULT) {
storage_status->update_cb = NULL;
+ }
pthread_mutex_unlock(&storage_status->update_data_mutex);
pthread_mutex_lock(&storage_status->exit_mutex);
storage_status->type = MF_STORAGE_SLEEP;
//pthread_cond_signal(&storage_status->wait_cond);
pthread_mutex_unlock(&storage_status->update_mutex);
- if (storage_status->tid > 0)
- {
+ if (storage_status->tid > 0) {
void *thread_ret = NULL;
ret = pthread_join(storage_status->tid, &thread_ret);
if (ret != 0) {
bool mf_storage_get_recent_files_size_cb(MFRitem *Ritem, void *user_data)
{
if (Ritem && Ritem->path) {
- SECURE_ERROR("Ritem->path is [%s]mf_file_exists is [%d] access(dst_dir, R_OK | W_OK) is [%d] ",Ritem->path, mf_file_exists(Ritem->path), access(Ritem->path, R_OK | W_OK));
+ SECURE_ERROR("Ritem->path is [%s]mf_file_exists is [%d] access(dst_dir, R_OK | W_OK) is [%d] ", Ritem->path, mf_file_exists(Ritem->path), access(Ritem->path, R_OK | W_OK));
if (mf_file_exists(Ritem->path)) {
off_t size = 0;
mf_file_attr_get_file_size(Ritem->path, &size);
int mf_ta_init(void)
{
- if (mf_g_accums)
+ if (mf_g_accums) {
return 0;
+ }
mf_g_cps = (mf_ta_checkpoint **) malloc(MF_TA_MAX_CHECKPOINT * sizeof(mf_ta_checkpoint *));
- if (!mf_g_cps)
+ if (!mf_g_cps) {
return -1;
+ }
mf_g_accums = (mf_ta_accum_item **) malloc(MF_TA_MAX_CHECKPOINT * sizeof(mf_ta_accum_item *));
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return -1;
+ }
mf_g_accum_first_time = 0xFFFFFFFF;
int mf_ta_release(void)
{
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return 0;
+ }
__mf_ta_free_cps();
__mf_ta_free_accums();
mf_ta_checkpoint *cp = NULL;
struct timeval t;
- if (!mf_g_enable)
+ if (!mf_g_enable) {
return -1;
+ }
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return 0;
+ }
- if (mf_g_cp_index == MF_TA_MAX_CHECKPOINT)
+ if (mf_g_cp_index == MF_TA_MAX_CHECKPOINT) {
return -1;
+ }
- if (!name)
+ if (!name) {
return -1;
+ }
- if (strlen(name) == 0)
+ if (strlen(name) == 0) {
return -1;
+ }
cp = (mf_ta_checkpoint *) malloc(sizeof(mf_ta_checkpoint));
- if (!cp)
+ if (!cp) {
return -1;
+ }
cp->name = (char *)malloc(strlen(name) + 1);
if (!cp->name) {
}
strncpy(cp->name, name, strlen(name));
- if (show)
+ if (show) {
SECURE_DEBUG("[CHECK-POINT] %s...(%s:%d)\n", name, filename, line);
+ }
gettimeofday(&t, NULL);
cp->timestamp = t.tv_sec * 1000000L + t.tv_usec;
void mf_ta_show_checkpoints(void)
{
int i = 0;
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return;
+ }
SECURE_DEBUG("BEGIN RESULT ============================\n");
for (i = 0; i < mf_g_cp_index; i++) {
void mf_ta_show_diff(char *name1, char *name2)
{
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return;
+ }
SECURE_DEBUG("Time takes from [%s] to [%s] : %ld us.\n", name1, name2, mf_ta_get_diff(name1, name2));
{
int cp1, cp2;
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return 0;
+ }
/* fail if bad param. */
- if (!name1 || !name2)
+ if (!name1 || !name2) {
return -1;
+ }
/* fail if same. */
- if (strcmp(name1, name2) == 0)
+ if (strcmp(name1, name2) == 0) {
return -1;
+ }
/*get index */
- if ((cp1 = __mf_ta_get_cp_index(name1)) == -1)
+ if ((cp1 = __mf_ta_get_cp_index(name1)) == -1) {
return -1;
+ }
- if ((cp2 = __mf_ta_get_cp_index(name2)) == -1)
+ if ((cp2 = __mf_ta_get_cp_index(name2)) == -1) {
return -1;
+ }
/* NOTE :
* return value must be positive value.
/* find index */
for (i = 0; i < mf_g_cp_index; i++) {
- if (strcmp(name, mf_g_cps[i]->name) == 0)
+ if (strcmp(name, mf_g_cps[i]->name) == 0) {
return i;
+ }
}
return -1;
/* find index */
for (i = 0; i < mf_g_accum_index; i++) {
- if (strcmp(name, mf_g_accums[i]->name) == 0)
+ if (strcmp(name, mf_g_accums[i]->name) == 0) {
return i;
+ }
}
return -1;
{
int i = 0;
- if (!mf_g_cps)
+ if (!mf_g_cps) {
return;
+ }
for (i = 0; i < mf_g_cp_index; i++) {
if (mf_g_cps[i]) {
- if (mf_g_cps[i]->name)
+ if (mf_g_cps[i]->name) {
free(mf_g_cps[i]->name);
+ }
free(mf_g_cps[i]);
{
int i = 0;
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return;
+ }
for (i = 0; i < mf_g_accum_index; i++) {
if (mf_g_accums[i]) {
- if (mf_g_accums[i]->name)
+ if (mf_g_accums[i]->name) {
free(mf_g_accums[i]->name);
+ }
free(mf_g_accums[i]);
int name_len = 0;
struct timeval t;
- if (!mf_g_enable)
+ if (!mf_g_enable) {
return -1;
+ }
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return 0;
+ }
- if (mf_g_accum_index == MF_TA_MAX_ACCUM)
+ if (mf_g_accum_index == MF_TA_MAX_ACCUM) {
return -1;
+ }
- if (!name)
+ if (!name) {
return -1;
+ }
name_len = strlen(name);
- if (name_len == 0)
+ if (name_len == 0) {
return -1;
+ }
/* if 'name' is new one. create new item. */
if ((index = __mf_ta_get_accum_index(name)) == -1) {
accum = (mf_ta_accum_item *) malloc(sizeof(mf_ta_accum_item));
- if (!accum)
+ if (!accum) {
return -1;
+ }
/*clear first. */
memset(accum, 0, sizeof(mf_ta_accum_item));
mf_g_accums[mf_g_accum_index] = accum;
mf_g_accum_index++;
- if (mf_g_accum_longest_name < name_len)
+ if (mf_g_accum_longest_name < name_len) {
mf_g_accum_longest_name = name_len;
+ }
} else {
accum = mf_g_accums[index];
if (accum->first_start == 0) { /* assum that timestamp never could be zero. */
accum->first_start = accum->timestamp;
- if (mf_g_accum_first_time > accum->first_start)
+ if (mf_g_accum_first_time > accum->first_start) {
mf_g_accum_first_time = accum->first_start;
+ }
}
- if (show)
+ if (show) {
SECURE_DEBUG("[ACCUM BEGIN] %s : %ld ---(%s:%d)\n", name, accum->timestamp, filename, line);
+ }
accum->num_calls++;
int index = 0;
struct timeval t;
- if (!mf_g_enable)
+ if (!mf_g_enable) {
return -1;
+ }
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return 0;
+ }
/* get time first for more accuracy. */
gettimeofday(&t, NULL);
- if (mf_g_accum_index == MF_TA_MAX_ACCUM)
+ if (mf_g_accum_index == MF_TA_MAX_ACCUM) {
return -1;
+ }
- if (!name)
+ if (!name) {
return -1;
+ }
- if (strlen(name) == 0)
+ if (strlen(name) == 0) {
return -1;
+ }
/* varify the 'name' is already exist. */
if ((index = __mf_ta_get_accum_index(name)) == -1) {
accum->elapsed_max = tval > accum->elapsed_max ? tval : accum->elapsed_max;
accum->elapsed_min = tval < accum->elapsed_min ? tval : accum->elapsed_min;
- if (show)
+ if (show) {
SECURE_DEBUG("[ACCUM END] %s : %ld + %u ---(%s:%d)\n", name, accum->elapsed_accum, tval, filename, line);
+ }
/* add elapsed time */
accum->elapsed_accum += tval;
void __mf_ta_print_some_info(FILE *fp)
{
- if (!fp)
+ if (!fp) {
return;
+ }
/* comment */
{
fprintf(fp, "Process priority : %d\n", getpriority(PRIO_PROCESS, getpid()));
getrusage(RUSAGE_SELF, &r_usage);
fprintf(fp, "CPU usage : User = %ld.%06ld, System = %ld.%06ld\n",
- r_usage.ru_utime.tv_sec, r_usage.ru_utime.tv_usec, r_usage.ru_stime.tv_sec, r_usage.ru_stime.tv_usec);
+ r_usage.ru_utime.tv_sec, r_usage.ru_utime.tv_usec, r_usage.ru_stime.tv_sec, r_usage.ru_stime.tv_usec);
}
char format[256];
FILE *fp = stderr;
- if (!mf_g_accums)
+ if (!mf_g_accums) {
return;
+ }
switch (direction) {
case MF_TA_SHOW_STDOUT:
case MF_TA_SHOW_STDERR:
fp = stderr;
break;
- case MF_TA_SHOW_FILE:
- {
- fp = fopen(MF_TA_RESULT_FILE, "wt");
- if (!fp)
- return;
+ case MF_TA_SHOW_FILE: {
+ fp = fopen(MF_TA_RESULT_FILE, "wt");
+ if (!fp) {
+ return;
}
}
+ }
__mf_ta_print_some_info(fp);
#ifdef MF_TA_UNIT_MSEC
snprintf(format, sizeof(format),
- "[%%3d] %%-%ds | \ttotal : %%4ld\tcalls : %%3ld\tavg : %%4ld\tmin : %%4ld\tmax : %%4ld\tstart : %%4lu\tend : %%4lu\tunpair : %%3ld\n",
- mf_g_accum_longest_name);
+ "[%%3d] %%-%ds | \ttotal : %%4ld\tcalls : %%3ld\tavg : %%4ld\tmin : %%4ld\tmax : %%4ld\tstart : %%4lu\tend : %%4lu\tunpair : %%3ld\n",
+ mf_g_accum_longest_name);
fprintf(fp, "BEGIN RESULT ACCUM============================ : NumOfItems : %d, unit(msec)\n", mf_g_accum_index);
#else
snprintf(format, sizeof(format),
- "[%%3d] %%-%ds : \ttotal : %%ld\t:calls : %%ld\t:avg : %%ld\tmin : %%ld\tmax : %%ld\tstart : %%lu\tend : %%lu\tunpair : %%ld\n",
- mf_g_accum_longest_name);
+ "[%%3d] %%-%ds : \ttotal : %%ld\t:calls : %%ld\t:avg : %%ld\tmin : %%ld\tmax : %%ld\tstart : %%lu\tend : %%lu\tunpair : %%ld\n",
+ mf_g_accum_longest_name);
fprintf(fp, "BEGIN RESULT ACCUM============================ : NumOfItems : %d, unit(usec)\n", mf_g_accum_index);
#endif
for (i = 0; i < mf_g_accum_index; i++) {
/*prevent 'devide by zero' error */
- if (mf_g_accums[i]->num_calls == 0)
+ if (mf_g_accums[i]->num_calls == 0) {
mf_g_accums[i]->num_calls = 1;
+ }
fprintf(fp, format, i, mf_g_accums[i]->name, mf_g_accums[i]->elapsed_accum, mf_g_accums[i]->num_calls,
- (mf_g_accums[i]->elapsed_accum == 0) ? 0 : (int)(mf_g_accums[i]->elapsed_accum / mf_g_accums[i]->num_calls),
- mf_g_accums[i]->elapsed_min,
- mf_g_accums[i]->elapsed_max,
- mf_g_accums[i]->first_start - mf_g_accum_first_time,
- mf_g_accums[i]->last_end - mf_g_accum_first_time, mf_g_accums[i]->num_unpair);
+ (mf_g_accums[i]->elapsed_accum == 0) ? 0 : (int)(mf_g_accums[i]->elapsed_accum / mf_g_accums[i]->num_calls),
+ mf_g_accums[i]->elapsed_min,
+ mf_g_accums[i]->elapsed_max,
+ mf_g_accums[i]->first_start - mf_g_accum_first_time,
+ mf_g_accums[i]->last_end - mf_g_accum_first_time, mf_g_accums[i]->num_unpair);
}
fprintf(fp, "END RESULT ACCUM ============================\n");
- if (direction == MF_TA_SHOW_FILE)
+ if (direction == MF_TA_SHOW_FILE) {
fclose(fp);
+ }
}
#endif
struct stat statbuf = {0};
struct tm tmtime;
- if (!filename || !node)
+ if (!filename || !node) {
return UG_MYFILE_ERR_GET_STAT_FAIL;
+ }
- if (stat(filename, &statbuf) == -1)
+ if (stat(filename, &statbuf) == -1) {
return UG_MYFILE_ERR_GET_STAT_FAIL;
+ }
- if (*node == NULL)
+ if (*node == NULL) {
return UG_MYFILE_ERR_GET_STAT_FAIL;
+ }
- (*node)->size = (LONG_LONG_UNSIGNED_INT)statbuf.st_size;
- //(*node)->size = (LONG_LONG_UNSIGNED_INT)12*1024*1024*1024;//for testing for 12G
- time_t temptime = statbuf.st_mtime;
+ (*node)->size = (LONG_LONG_UNSIGNED_INT)statbuf.st_size;
+ //(*node)->size = (LONG_LONG_UNSIGNED_INT)12*1024*1024*1024;//for testing for 12G
+ time_t temptime = statbuf.st_mtime;
- if (temptime == 0 && !g_strcmp0(filename, UG_MEMORY_FOLDER))
- {
- if(stat(UG_MEMORY_DEV_FOLDER, &statbuf) == -1)
- {
+ if (temptime == 0 && !g_strcmp0(filename, UG_MEMORY_FOLDER)) {
+ if (stat(UG_MEMORY_DEV_FOLDER, &statbuf) == -1) {
temptime = time(NULL);
localtime_r(&temptime, &tmtime);
- }
- else
- {
+ } else {
temptime = statbuf.st_mtime;
}
}
int mf_ug_detail_fs_is_dir(const char *filepath)
{
- if (filepath == NULL)
+ if (filepath == NULL) {
return EINA_FALSE;
+ }
return mf_is_dir(filepath);
}
int mf_ug_detail_fs_get_file_ext(const char *filepath, char *file_ext)
{
- if (filepath == NULL || file_ext == NULL)
+ if (filepath == NULL || file_ext == NULL) {
return UG_MYFILE_ERR_SRC_ARG_INVALID;
+ }
const char *filename = mf_file_get(filepath);
- if (filename == NULL)
+ if (filename == NULL) {
return UG_MYFILE_ERR_INVALID_FILE_NAME;
+ }
char *pdot = strrchr(filename, '.');
if (!pdot) {
static File_Type __mf_ug_detail_fs_get_category_by_file_ext(const char *file_ext, const char *fullpath)
{
int i = 0;
- if (file_ext == NULL)
+ if (file_ext == NULL) {
return FILE_TYPE_ETC;
+ }
- if (file_ext[0] == '.')
+ if (file_ext[0] == '.') {
i = 1;
+ }
switch (file_ext[i]) {
case 'a':
case 'A':
- if (strcasecmp("ASF", &file_ext[i]) == 0)
- return FILE_TYPE_VIDEO; /*2010.3.12. dsp.shin appended*/
+ if (strcasecmp("ASF", &file_ext[i]) == 0) {
+ return FILE_TYPE_VIDEO; /*2010.3.12. dsp.shin appended*/
+ }
- if (strcasecmp("AMR", &file_ext[i]) == 0)
+ if (strcasecmp("AMR", &file_ext[i]) == 0) {
return FILE_TYPE_VOICE;
+ }
- if (strcasecmp("AWB", &file_ext[i]) == 0)
- return FILE_TYPE_VOICE; /*2009.4.8 han. open wideband amr*/
+ if (strcasecmp("AWB", &file_ext[i]) == 0) {
+ return FILE_TYPE_VOICE; /*2009.4.8 han. open wideband amr*/
+ }
- if (strcasecmp("AAC", &file_ext[i]) == 0)
+ if (strcasecmp("AAC", &file_ext[i]) == 0) {
return FILE_TYPE_MUSIC;
+ }
- if (strcasecmp("AVI", &file_ext[i]) == 0)
+ if (strcasecmp("AVI", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
- if (strcasecmp("AAC", &file_ext[i]) == 0)
- return FILE_TYPE_MUSIC; /*2010.4.12 shyeon.kim appended*/
+ if (strcasecmp("AAC", &file_ext[i]) == 0) {
+ return FILE_TYPE_MUSIC; /*2010.4.12 shyeon.kim appended*/
+ }
break;
case 'b':
case 'B':
- if (strcasecmp("BMP", &file_ext[i]) == 0)
+ if (strcasecmp("BMP", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
break;
case 'd':
case 'D':
- if (strcasecmp("DOC", &file_ext[i]) == 0)
+ if (strcasecmp("DOC", &file_ext[i]) == 0) {
return FILE_TYPE_DOC;
+ }
- if (strcasecmp("DOCX", &file_ext[i]) == 0)
+ if (strcasecmp("DOCX", &file_ext[i]) == 0) {
return FILE_TYPE_DOC;
+ }
if (strcasecmp("DIVX", &file_ext[i]) == 0) {
{
break;
case 'g':
case 'G':
- if (strcasecmp("GIF", &file_ext[i]) == 0)
+ if (strcasecmp("GIF", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
- if (strcasecmp("G72", &file_ext[i]) == 0)
+ if (strcasecmp("G72", &file_ext[i]) == 0) {
return FILE_TYPE_MUSIC;
+ }
break;
case 'h':
case 'H':
- if (strcasecmp("H263", &file_ext[i]) == 0)
+ if (strcasecmp("H263", &file_ext[i]) == 0) {
return FILE_TYPE_MUSIC;
+ }
- if (strcasecmp("HTML", &file_ext[i]) == 0)
+ if (strcasecmp("HTML", &file_ext[i]) == 0) {
return FILE_TYPE_HTML;
+ }
- if (strcasecmp("HTM", &file_ext[i]) == 0)
+ if (strcasecmp("HTM", &file_ext[i]) == 0) {
return FILE_TYPE_HTML;
+ }
break;
case 'i':
case 'I':
- if (strcasecmp("IMY", &file_ext[i]) == 0)
+ if (strcasecmp("IMY", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("IPK", &file_ext[i]) == 0)
+ if (strcasecmp("IPK", &file_ext[i]) == 0) {
return FILE_TYPE_APP;
+ }
break;
case 'j':
case 'J':
/*2009.5.7 han. added for java*/
- if (strcasecmp("JAD", &file_ext[i]) == 0)
+ if (strcasecmp("JAD", &file_ext[i]) == 0) {
return FILE_TYPE_JAVA;
+ }
- if (strcasecmp("JAR", &file_ext[i]) == 0)
+ if (strcasecmp("JAR", &file_ext[i]) == 0) {
return FILE_TYPE_JAVA;
+ }
- if (strcasecmp("JPG", &file_ext[i]) == 0)
+ if (strcasecmp("JPG", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
- if (strcasecmp("JPEG", &file_ext[i]) == 0)
+ if (strcasecmp("JPEG", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
/*2008.5.1 han. MTA issue.*/
- if (strcasecmp("JPE", &file_ext[i]) == 0)
+ if (strcasecmp("JPE", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
break;
case 'm':
case 'M':
- if (strcasecmp("MMF", &file_ext[i]) == 0)
+ if (strcasecmp("MMF", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("MP3", &file_ext[i]) == 0)
+ if (strcasecmp("MP3", &file_ext[i]) == 0) {
return FILE_TYPE_MUSIC;
+ }
- if (strcasecmp("MID", &file_ext[i]) == 0)
+ if (strcasecmp("MID", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("MIDI", &file_ext[i]) == 0)
+ if (strcasecmp("MIDI", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("MP4", &file_ext[i]) == 0)
+ if (strcasecmp("MP4", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
/*"mp4" may be music*/
- if (strcasecmp("MPG", &file_ext[i]) == 0)
+ if (strcasecmp("MPG", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
- if (strcasecmp("MPEG", &file_ext[i]) == 0)
+ if (strcasecmp("MPEG", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
- if (strcasecmp("M4A", &file_ext[i]) == 0)
+ if (strcasecmp("M4A", &file_ext[i]) == 0) {
return FILE_TYPE_MUSIC;
+ }
- if (strcasecmp("M3G", &file_ext[i]) == 0)
+ if (strcasecmp("M3G", &file_ext[i]) == 0) {
return FILE_TYPE_FLASH;
+ }
- if (strcasecmp("MXMF", &file_ext[i]) == 0)
+ if (strcasecmp("MXMF", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("MKV", &file_ext[i]) == 0)
- return FILE_TYPE_VIDEO; /*2010.4.12 shyeon.kim appended*/
+ if (strcasecmp("MKV", &file_ext[i]) == 0) {
+ return FILE_TYPE_VIDEO; /*2010.4.12 shyeon.kim appended*/
+ }
- if (strcasecmp("MKA", &file_ext[i]) == 0)
- return FILE_TYPE_MUSIC; /*2010.4.12 shyeon.kim appended*/
+ if (strcasecmp("MKA", &file_ext[i]) == 0) {
+ return FILE_TYPE_MUSIC; /*2010.4.12 shyeon.kim appended*/
+ }
break;
case 'o':
case 'O':
- if (strcasecmp("opml", &file_ext[i]) == 0)
+ if (strcasecmp("opml", &file_ext[i]) == 0) {
return FILE_TYPE_RSS;
+ }
break;
case 'p':
case 'P':
- if (strcasecmp("PNG", &file_ext[i]) == 0)
+ if (strcasecmp("PNG", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
- if (strcasecmp("PJPEG", &file_ext[i]) == 0)
+ if (strcasecmp("PJPEG", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
- if (strcasecmp("PDF", &file_ext[i]) == 0)
+ if (strcasecmp("PDF", &file_ext[i]) == 0) {
return FILE_TYPE_PDF;
+ }
- if (strcasecmp("PPT", &file_ext[i]) == 0)
+ if (strcasecmp("PPT", &file_ext[i]) == 0) {
return FILE_TYPE_PPT;
+ }
- if (strcasecmp("PPTX", &file_ext[i]) == 0)
+ if (strcasecmp("PPTX", &file_ext[i]) == 0) {
return FILE_TYPE_PPT;
+ }
- if (strcasecmp("PEM", &file_ext[i]) == 0)
+ if (strcasecmp("PEM", &file_ext[i]) == 0) {
return FILE_TYPE_CERTIFICATION;
+ }
break;
/* 2008.3.5 han.*/
break;
case 's':
case 'S':
- if (strcasecmp("SDP", &file_ext[i]) == 0)
+ if (strcasecmp("SDP", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
- if (strcasecmp("SPM", &file_ext[i]) == 0)
+ if (strcasecmp("SPM", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("SMP", &file_ext[i]) == 0)
+ if (strcasecmp("SMP", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("SPF", &file_ext[i]) == 0)
+ if (strcasecmp("SPF", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("SWF", &file_ext[i]) == 0)
+ if (strcasecmp("SWF", &file_ext[i]) == 0) {
return FILE_TYPE_FLASH;
+ }
- if (strcasecmp("SCN", &file_ext[i]) == 0)
+ if (strcasecmp("SCN", &file_ext[i]) == 0) {
return FILE_TYPE_MOVIE_MAKER;
+ }
- if (strcasecmp("SVG", &file_ext[i]) == 0)
+ if (strcasecmp("SVG", &file_ext[i]) == 0) {
return FILE_TYPE_SVG;
+ }
- if (strcasecmp("SVGZ", &file_ext[i]) == 0)
- return FILE_TYPE_SVG; /* 2009.4.17 han.*/
+ if (strcasecmp("SVGZ", &file_ext[i]) == 0) {
+ return FILE_TYPE_SVG; /* 2009.4.17 han.*/
+ }
break;
case 't':
case 'T':
- if (strcasecmp("TXT", &file_ext[i]) == 0)
+ if (strcasecmp("TXT", &file_ext[i]) == 0) {
return FILE_TYPE_TXT;
+ }
- if (strcasecmp("THM", &file_ext[i]) == 0)
+ if (strcasecmp("THM", &file_ext[i]) == 0) {
return FILE_TYPE_THEME;
+ }
break;
case 'v':
case 'V':
- if (strcasecmp("VCF", &file_ext[i]) == 0)
+ if (strcasecmp("VCF", &file_ext[i]) == 0) {
return FILE_TYPE_VCONTACT;
+ }
- if (strcasecmp("VCS", &file_ext[i]) == 0)
+ if (strcasecmp("VCS", &file_ext[i]) == 0) {
return FILE_TYPE_VCALENDAR;
+ }
- if (strcasecmp("VNT", &file_ext[i]) == 0)
+ if (strcasecmp("VNT", &file_ext[i]) == 0) {
return FILE_TYPE_VNOTE;
+ }
- if (strcasecmp("VBM", &file_ext[i]) == 0)
+ if (strcasecmp("VBM", &file_ext[i]) == 0) {
return FILE_TYPE_VBOOKMARK;
+ }
break;
case 'w':
case 'W':
- if (strcasecmp("WAV", &file_ext[i]) == 0)
- return FILE_TYPE_SOUND; /*modified by dsp.shin, 2010.3.13. to support music player*/
+ if (strcasecmp("WAV", &file_ext[i]) == 0) {
+ return FILE_TYPE_SOUND; /*modified by dsp.shin, 2010.3.13. to support music player*/
+ }
/*2008.10.17 han.*/
- if (strcasecmp("WBMP", &file_ext[i]) == 0)
+ if (strcasecmp("WBMP", &file_ext[i]) == 0) {
return FILE_TYPE_IMAGE;
+ }
- if (strcasecmp("WGT", &file_ext[i]) == 0)
+ if (strcasecmp("WGT", &file_ext[i]) == 0) {
return FILE_TYPE_WGT;
+ }
- if (strcasecmp("WMA", &file_ext[i]) == 0)
+ if (strcasecmp("WMA", &file_ext[i]) == 0) {
return FILE_TYPE_MUSIC;
+ }
- if (strcasecmp("WMV", &file_ext[i]) == 0)
+ if (strcasecmp("WMV", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
break;
case 'x':
case 'X':
- if (strcasecmp("XLS", &file_ext[i]) == 0)
+ if (strcasecmp("XLS", &file_ext[i]) == 0) {
return FILE_TYPE_EXCEL;
+ }
- if (strcasecmp("XLSX", &file_ext[i]) == 0)
+ if (strcasecmp("XLSX", &file_ext[i]) == 0) {
return FILE_TYPE_EXCEL;
+ }
- if (strcasecmp("XMF", &file_ext[i]) == 0)
+ if (strcasecmp("XMF", &file_ext[i]) == 0) {
return FILE_TYPE_SOUND;
+ }
- if (strcasecmp("XHTML", &file_ext[i]) == 0)
+ if (strcasecmp("XHTML", &file_ext[i]) == 0) {
return FILE_TYPE_HTML;
+ }
break;
case '3':
- if (strcasecmp("3GP", &file_ext[i]) == 0)
+ if (strcasecmp("3GP", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
- if (strcasecmp("3GPP", &file_ext[i]) == 0)
+ if (strcasecmp("3GPP", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
- if (strcasecmp("3G2", &file_ext[i]) == 0)
+ if (strcasecmp("3G2", &file_ext[i]) == 0) {
return FILE_TYPE_VIDEO;
+ }
/*"3GP", "3GPP" may be music*/
break;
int mf_ug_detail_fs_get_file_type(const char *filepath, File_Type * category)
{
- if (filepath == NULL || category == NULL)
+ if (filepath == NULL || category == NULL) {
return UG_MYFILE_ERR_SRC_ARG_INVALID;
+ }
int i = 0;
int flag = 0;
*********************/
int mf_ug_detail_fs_get_store_type(const char *filepath, Mf_Storage *store_type)
{
- if (filepath == NULL || store_type == NULL)
+ if (filepath == NULL || store_type == NULL) {
return UG_MYFILE_ERR_SRC_ARG_INVALID;
+ }
if (g_str_has_prefix(filepath, UG_PHONE_FOLDER)) {
*store_type = D_MYFILE_PHONE;
*********************/
int mf_ug_detail_fs_get_logi_path(const char *full_path, char *path)
{
- if (full_path == NULL || path == NULL)
+ if (full_path == NULL || path == NULL) {
return UG_MYFILE_ERR_STORAGE_TYPE_ERROR;
+ }
Mf_Storage store_type = 0;
int root_len = 0;
/*size of path is UG_MYFILE_DIR_PATH_LEN_MAX+1*/
g_strlcpy(path, full_path + root_len, UG_MYFILE_DIR_PATH_LEN_MAX);
- if (strlen(path) == 0)
+ if (strlen(path) == 0) {
g_strlcpy(path, "/", UG_MYFILE_DIR_PATH_LEN_MAX);
+ }
return UG_MYFILE_ERR_NONE;
GString *catetory = NULL;
File_Type category_t = FILE_TYPE_NONE;
- if (path != NULL)
+ if (path != NULL) {
mf_ug_detail_fs_get_file_type(path->str, &category_t);
+ }
switch (category_t) {
case FILE_TYPE_NONE: /**< Default */
******************************/
int mf_ug_detail_fs_get_list_len(const Eina_List *list)
{
- if (list == NULL)
+ if (list == NULL) {
return 0;
+ }
return eina_list_count(list);
}
{
myfile_dlog("%s %d\n", __func__, __LINE__);
- if (path == NULL)
+ if (path == NULL) {
return VIEW_NONE;
+ }
if (mf_ug_detail_fs_is_dir(path)) {
return VIEW_DIR;
static int __mf_ug_detail_fs_get_parent_path(const char *path, char *parent_path)
{
- if (path == NULL || parent_path == NULL)
+ if (path == NULL || parent_path == NULL) {
return UG_MYFILE_ERR_SRC_ARG_INVALID;
+ }
/*parent_path size is UG_MYFILE_DIR_PATH_LEN_MAX+1*/
g_strlcpy(parent_path, path, UG_MYFILE_DIR_PATH_LEN_MAX);
const char *name = NULL;
name = mf_file_get(path);
- if (name == NULL)
+ if (name == NULL) {
return UG_MYFILE_ERR_SRC_ARG_INVALID;
+ }
parent_path[strlen(parent_path) - strlen(name) - 1] = '\0';
- if (strlen(parent_path) == 0)
+ if (strlen(parent_path) == 0) {
g_strlcpy(parent_path, "/", UG_MYFILE_DIR_PATH_LEN_MAX);
+ }
myfile_dlog("%s %d\n", __func__, __LINE__);
char path[UG_MYFILE_DIR_PATH_LEN_MAX + 1] = { '\0', };
int error_code = 0;
- if (fullpath == NULL)
+ if (fullpath == NULL) {
return NULL;
+ }
error_code = __mf_ug_detail_fs_get_parent_path(fullpath, path);
- if (error_code != 0)
+ if (error_code != 0) {
return NULL;
+ }
ret = g_string_new(path);
myfile_dlog("%s %d\n", __func__, __LINE__);
*********************/
int mf_ug_detail_fs_read_dir(char *path, Eina_List **dir_list, Eina_List **file_list)
{
- if (path == NULL)
+ if (path == NULL) {
return UG_MYFILE_ERR_DIR_OPEN_FAIL;
+ }
DIR *pDir = NULL;
struct dirent ent_struct;
int ret = 0;
pDir = opendir(path);
- if (pDir == NULL)
+ if (pDir == NULL) {
return UG_MYFILE_ERR_DIR_OPEN_FAIL;
+ }
while ((readdir_r(pDir, &ent_struct, &ent) == 0) && ent) {
if (strncmp(ent->d_name, ".", 1) == 0 || strcmp(ent->d_name, "..") == 0) {
continue;
}
/*only deal with dirs and regular files*/
- if ((ent->d_type & DT_DIR) == 0 && (ent->d_type & DT_REG) == 0)
+ if ((ent->d_type & DT_DIR) == 0 && (ent->d_type & DT_REG) == 0) {
continue;
+ }
#ifdef DEBUG_FOLDER_OPTION
if ((ent->d_type & DT_DIR) != 0) {
if ((strlen(path) == strlen(UG_PHONE_FOLDER)) && (g_strcmp0(path, UG_PHONE_FOLDER) == 0) &&
- (strlen(ent->d_name) == strlen(DEBUG_FOLDER)) && (g_strcmp0(ent->d_name, DEBUG_FOLDER) == 0)) {
+ (strlen(ent->d_name) == strlen(DEBUG_FOLDER)) && (g_strcmp0(ent->d_name, DEBUG_FOLDER) == 0)) {
continue;
}
}
#endif
Node_Info *pNode = (Node_Info *) malloc(sizeof(Node_Info));
- if (pNode == NULL)
+ if (pNode == NULL) {
continue;
+ }
memset(pNode, 0, sizeof(Node_Info));
/*get path*/
myfile_dlog("%s %d\n", __func__, __LINE__);
- if (folder_name == NULL || folder_name->str == NULL || folder_name->len == 0)
+ if (folder_name == NULL || folder_name->str == NULL || folder_name->len == 0) {
return 0;
+ }
int error_code = 0;
if (folder_name != NULL) {
if (statvfs(path, &statbuf) == -1) {
return use_space;
} else {
- use_space = (statbuf.f_blocks - statbuf.f_bfree)*statbuf.f_bsize;
+ use_space = (statbuf.f_blocks - statbuf.f_bfree) * statbuf.f_bsize;
}
}
return use_space;
if (mf_ug_detail_fs_is_dir(path)) {
size = mf_ug_detail_fs_get_storage_size(path);
- if (size != 0)
+ if (size != 0) {
return size;
+ }
int error_code = 0;
error_code = mf_ug_detail_fs_get_file_list(fullpath, &dir_list, &file_list);
for (i = 0; i < file_list_len; i++) {
Node_Info *pNode = NULL;
pNode = (Node_Info *) eina_list_nth(file_list, i);
- if (pNode == NULL)
+ if (pNode == NULL) {
continue;
+ }
size += pNode->size;
}
i = 0;
Node_Info *pNode = NULL;
char *full_path = NULL;
pNode = (Node_Info *) eina_list_nth(dir_list, i);
- if (pNode == NULL)
+ if (pNode == NULL) {
continue;
+ }
full_path = g_strconcat(pNode->path, "/", pNode->name, NULL);
myfile_dlog("full_path is [%s]\n", full_path);
size += (mf_ug_detail_fs_get_folder_size(full_path));
static void __mf_ug_detail_media_set_default_timezone_id()
{
- i18n_uchar utimezone_id [UG_ICU_ARR_LENGTH] = {0};
- char timezone_buffer[UG_ICU_ARR_LENGTH] = {0};
- char timezone_id[UG_ICU_ARR_LENGTH] = {0};
- char *buffer = NULL;
- int timezone_str_size;
- int retcode = -1;
-
- retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &buffer);
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE)
- {
- mf_error("[ERR] failed to get the timezone");
- }
- if (buffer)
- strncpy(timezone_id, buffer, sizeof(timezone_id)-1);
- timezone_str_size = readlink("/opt/etc/localtime", timezone_buffer, sizeof(timezone_buffer)-1);
- free(buffer);
-
- if (timezone_str_size > 0) {
- char *ptr, *sp, *zone= NULL, *city= NULL;
- ptr = strtok_r(timezone_buffer, "/", &sp);
-
- while ((ptr = strtok_r(NULL, "/", &sp)))
- {
- zone = city;
- city = ptr;
- }
-
- if (zone != NULL && city != NULL) {
- if (strcmp("zoneinfo", zone) == 0)
- snprintf(timezone_id, UG_ICU_ARR_LENGTH, "%s", city);
- else
- snprintf(timezone_id, UG_ICU_ARR_LENGTH, "%s/%s", zone, city);
- }
- }
-
- if (*timezone_id) {
- i18n_ustring_copy_ua_n(utimezone_id, timezone_id, sizeof(timezone_buffer)/2);
- retcode = i18n_ucalendar_set_default_timezone(utimezone_id);
- if (retcode != I18N_ERROR_NONE) {
- myfile_dlog("Failed to set default time zone[%d]!", retcode);
- }
- }
+ i18n_uchar utimezone_id [UG_ICU_ARR_LENGTH] = {0};
+ char timezone_buffer[UG_ICU_ARR_LENGTH] = {0};
+ char timezone_id[UG_ICU_ARR_LENGTH] = {0};
+ char *buffer = NULL;
+ int timezone_str_size;
+ int retcode = -1;
+
+ retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &buffer);
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
+ mf_error("[ERR] failed to get the timezone");
+ }
+ if (buffer) {
+ strncpy(timezone_id, buffer, sizeof(timezone_id) - 1);
+ }
+ timezone_str_size = readlink("/opt/etc/localtime", timezone_buffer, sizeof(timezone_buffer) - 1);
+ free(buffer);
+
+ if (timezone_str_size > 0) {
+ char *ptr, *sp, *zone = NULL, *city = NULL;
+ ptr = strtok_r(timezone_buffer, "/", &sp);
+
+ while ((ptr = strtok_r(NULL, "/", &sp))) {
+ zone = city;
+ city = ptr;
+ }
+
+ if (zone != NULL && city != NULL) {
+ if (strcmp("zoneinfo", zone) == 0) {
+ snprintf(timezone_id, UG_ICU_ARR_LENGTH, "%s", city);
+ } else {
+ snprintf(timezone_id, UG_ICU_ARR_LENGTH, "%s/%s", zone, city);
+ }
+ }
+ }
+
+ if (*timezone_id) {
+ i18n_ustring_copy_ua_n(utimezone_id, timezone_id, sizeof(timezone_buffer) / 2);
+ retcode = i18n_ucalendar_set_default_timezone(utimezone_id);
+ if (retcode != I18N_ERROR_NONE) {
+ myfile_dlog("Failed to set default time zone[%d]!", retcode);
+ }
+ }
}
static char *__mf_ug_detail_media_get_best_pattern(const char *locale, i18n_uchar *customSkeleton, i18n_udate date)
char formattedString[UG_ICU_ARR_LENGTH] = {0,};
int32_t bestPatternLength, formattedLength;
- __mf_ug_detail_media_set_default_timezone_id();
+ __mf_ug_detail_media_set_default_timezone_id();
status = i18n_udatepg_create(locale, &generator);
- if ((status != I18N_ERROR_NONE) || (generator == NULL))
+ if ((status != I18N_ERROR_NONE) || (generator == NULL)) {
return NULL;
+ }
status = i18n_udatepg_get_best_pattern(generator, customSkeleton, i18n_ustring_get_length(customSkeleton), bestPattern, UG_ICU_ARR_LENGTH, &bestPatternLength);
if (bestPatternLength <= 0) {
return NULL;
}
- status= i18n_udate_create(I18N_UDATE_MEDIUM, I18N_UDATE_MEDIUM, locale, NULL, -1, bestPattern, -1, &formatter);
+ status = i18n_udate_create(I18N_UDATE_MEDIUM, I18N_UDATE_MEDIUM, locale, NULL, -1, bestPattern, -1, &formatter);
if ((status != I18N_ERROR_NONE) || (formatter == NULL)) {
i18n_udatepg_destroy(generator);
return NULL;
i18n_udatepg_destroy(generator);
i18n_udate_destroy(formatter);
- if (strlen(formattedString) == 0)
+ if (strlen(formattedString) == 0) {
return NULL;
+ }
return g_strdup(formattedString);
}
i18n_uchar customSkeleton[UG_ICU_ARR_LENGTH] = { 0, };
int skeletonLength = 0;
bool timeformat = false;
- int retcode = -1;
+ int retcode = -1;
- retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &timeformat);
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- myfile_dlog("Failed to get timeformat info[%d]!", retcode);
- }
+ retcode = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &timeformat);
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
+ myfile_dlog("Failed to get timeformat info[%d]!", retcode);
+ }
if (timeformat == false) {
skeleton = g_strdup(UG_DATE_FORMAT_12);
if (find) {
int diff = find - region;
if (diff > 0) {
- region[diff-1] = '\0';
+ region[diff - 1] = '\0';
}
}
}
}
logic_path = (char *)malloc(UG_MYFILE_DIR_PATH_LEN_MAX + 1);
- if (logic_path == NULL)
+ if (logic_path == NULL) {
return;
+ }
memset(logic_path, 0, UG_MYFILE_DIR_PATH_LEN_MAX + 1);
int count = 1;
EINA_LIST_FOREACH(file_list, l, filenode) {
if (filenode) {
- ug_detail_debug("[file %d [%s]]",count, filenode->name);
+ ug_detail_debug("[file %d [%s]]", count, filenode->name);
count++;
}
}
count = 1;
EINA_LIST_FOREACH(dir_list, l, filenode) {
- ug_detail_debug("[folder %d [%s]]",count, filenode->name);
+ ug_detail_debug("[folder %d [%s]]", count, filenode->name);
count++;
}
buf = g_strdup_printf("%d %s %s %d %s", file_list_len, MF_UG_DETAIL_LABELL_FILES, ",", dir_list_len, MF_UG_DETAIL_LABELL_FOLDERS);
}
/** malloc for File_size */
- if (pNode != NULL)
+ if (pNode != NULL) {
original_size = pNode->size;
+ }
- if (mf_ug_detail_fs_is_dir(path))
+ if (mf_ug_detail_fs_is_dir(path)) {
original_size = mf_ug_detail_fs_get_folder_size(path);
+ }
size = (double)original_size;
}
ap->mf_Info.create_date = (char *)malloc(UG_FILE_CREATE_DATE_MAX + 1);
- if (ap->mf_Info.create_date == NULL)
+ if (ap->mf_Info.create_date == NULL) {
return;
+ }
memset(ap->mf_Info.create_date, 0, UG_FILE_CREATE_DATE_MAX + 1);
ap->mf_Info.file_ext = (char *)malloc(UG_FILE_EXT_LEN_MAX);
- if (ap->mf_Info.file_ext == NULL)
+ if (ap->mf_Info.file_ext == NULL) {
return;
+ }
memset(ap->mf_Info.file_ext, 0, UG_FILE_EXT_LEN_MAX);
int ret = mf_ug_detail_fs_get_file_ext(path, ap->mf_Info.file_ext);
//ExifIfd ifd;
ExifTag tag;
char buf[UG_EXIF_ARR_LENGTH + 1] = { 0, };
- if (file_full_path == NULL)
+ if (file_full_path == NULL) {
return -1;
+ }
- if (gps_value == NULL)
+ if (gps_value == NULL) {
return -1;
+ }
/** get exifdata*/
ed = exif_data_new_from_file(file_full_path);
- if (!ed)
+ if (!ed) {
return -1;
+ }
//ifd = ifdtype;
tag = tagtype;
static bool __mf_ug_detail_media_extract_image_meta_latitude(char *file_full_path, double *lat)
{
double value = 0.0;
- if (file_full_path == NULL || lat == NULL)
+ if (file_full_path == NULL || lat == NULL) {
return false;
+ }
/** check if the file exists*/
int ret = access(file_full_path, 0);
- if (ret == -1)
+ if (ret == -1) {
return false;
+ }
/** get laitude value by path*/
if (__mf_ug_detail_media_get_exif_gps_info(file_full_path, &value, EXIF_IFD_GPS, EXIF_TAG_GPS_LATITUDE) == 0) {
static bool __mf_ug_detail_media_extract_image_meta_lontitude(char *file_full_path, double *lon)
{
double value = 0.0;
- if (file_full_path == NULL || lon == NULL)
+ if (file_full_path == NULL || lon == NULL) {
return false;
+ }
/** check if the file exists*/
int ret = access(file_full_path, 0);
- if (ret == -1)
+ if (ret == -1) {
return false;
+ }
/** get lontitude by path*/
if (__mf_ug_detail_media_get_exif_gps_info(file_full_path, &value, EXIF_IFD_GPS, EXIF_TAG_GPS_LONGITUDE) == 0) {
myfile_dlog("*******************%s %d\n", __func__, __LINE__);
Node_Info *pNode = (Node_Info *) malloc(sizeof(Node_Info));
- if (pNode == NULL)
+ if (pNode == NULL) {
return;
+ }
memset(pNode, 0, sizeof(Node_Info));
mf_ug_detaill_fs_get_file_stat(path, &pNode);
fsNodeInfo *pNode = NULL;
if ((ap->mf_Status.view_type == mf_view_storage || ap->mf_Status.view_type == mf_view_root)
- && (ap->mf_Status.more == MORE_DEFAULT || ap->mf_Status.more == MORE_INTERNAL_COPY || ap->mf_Status.more == MORE_INTERNAL_MOVE || ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS)) {
+ && (ap->mf_Status.more == MORE_DEFAULT || ap->mf_Status.more == MORE_INTERNAL_COPY || ap->mf_Status.more == MORE_INTERNAL_MOVE || ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS)) {
Evas_Object *parent = NULL;
parent = ap->mf_MainWindow.pNaviGenlist;
if ((ap->mf_Status.iStorageState & MYFILE_MMC) && !__mf_util_storage_exist_check(parent, MYFILE_MMC)) {
pNode = (fsNodeInfo *) malloc(sizeof(fsNodeInfo));
- if (pNode == NULL)
+ if (pNode == NULL) {
return;
+ }
memset(pNode, 0, sizeof(fsNodeInfo));
/*set path */
pNode->path = g_strdup(STORAGE_PARENT);
struct appdata *ap = (struct appdata *)data;
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT, NULL, MF_MSG_MEMORY_NOT_ENOUGH,
- NULL, NULL, NULL, (Evas_Smart_Cb) elm_exit, NULL);
+ NULL, NULL, NULL, (Evas_Smart_Cb) elm_exit, NULL);
}
/******************************
} else {
mf_gengrid_align_set(ap->mf_MainWindow.pNaviGengrid, count);
}
- }else{//Fixed P140416-05429 by jian12.li
+ } else { //Fixed P140416-05429 by jian12.li
int count = elm_genlist_items_count(ap->mf_MainWindow.pNaviGenlist);
if (count == 0) {
ap->mf_Status.flagNoContent = EINA_TRUE;
}
SAFE_FREE_CHAR(ap->mf_Status.entry_path);
ap->mf_Status.entry_more = MORE_DEFAULT;
- /*3. refresh the content of the view */
+ /*3. refresh the content of the view */
if (ap->mf_Status.view_type != mf_view_root_category && ap->mf_Status.more != MORE_SEARCH) {
mf_navi_bar_recover_info_box(ap);
}
} else if (ap->mf_Status.view_type == mf_view_recent) {
mf_navi_bar_title_content_set(ap, MF_LABEL_RECTENT_FILES);
} else {
- mf_navi_bar_title_content_set(ap,ap->mf_MainWindow.naviframe_title);
+ mf_navi_bar_title_content_set(ap, ap->mf_MainWindow.naviframe_title);
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_TRUE, EINA_TRUE);
}
} else if (ap->mf_Status.more != MORE_EDIT_RENAME) {
} else {
if (ap->mf_Status.view_type == mf_view_root_category
- && (ap->mf_Status.more == MORE_COMPRESS || ap->mf_Status.more == MORE_DECOMPRESS
- || ap->mf_Status.more == MORE_DECOMPRESS_HERE)) {
+ && (ap->mf_Status.more == MORE_COMPRESS || ap->mf_Status.more == MORE_DECOMPRESS
+ || ap->mf_Status.more == MORE_DECOMPRESS_HERE)) {
ap->mf_Status.more = MORE_DEFAULT;
message = MF_LABEL_SUCCESS;
mf_category_view_create(ap, true);
EXIT_WITH_POPUP:
mf_error("ap->mf_FileOperation.message_type is [%d] message is [%s]",
- ap->mf_FileOperation.message_type, message);
- if (message == NULL)
- {
- mf_error("Message NULL..!!");
- return;
- }
+ ap->mf_FileOperation.message_type, message);
+ if (message == NULL) {
+ mf_error("Message NULL..!!");
+ return;
+ }
if (ap->mf_FileOperation.message_type == message_type_notification) {
mf_popup_indicator_popup(ap, mf_util_get_text(message));
ap->mf_FileOperation.pOperationMsg = NULL;
} else {
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL,
- message, MF_BUTTON_LABEL_OK,
- NULL, NULL, mf_callback_warning_popup_cb, ap);
+ message, MF_BUTTON_LABEL_OK,
+ NULL, NULL, mf_callback_warning_popup_cb, ap);
ap->mf_FileOperation.pOperationMsg = NULL;
}
** 1. Recursion move/copy
** 2. move with same file in the same folder
*/
- MF_TRACE_BEGIN
+ MF_TRACE_BEGIN
mf_retvm_if(data == NULL, false, "passed data is NULL");
struct appdata *ap = (struct appdata *)data;
*/
if (free_space == 0) {
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL,
- MF_LABE_NOT_ENOUGH_MEMORY_DELETE_SOME_ITEMS_AND_TRY_AGAIN, MF_BUTTON_LABEL_OK,
- NULL, NULL, mf_callback_warning_popup_cb, ap);
+ MF_LABE_NOT_ENOUGH_MEMORY_DELETE_SOME_ITEMS_AND_TRY_AGAIN, MF_BUTTON_LABEL_OK,
+ NULL, NULL, mf_callback_warning_popup_cb, ap);
mf_debug("Not Enough free size\n");
return MYFILE_ERR_NO_FREE_SPACE;
}
ret = media_info_cancel_thumbnail((*item_data)->media);
}
if (ret == MEDIA_CONTENT_ERROR_NONE) {
- media_info_destroy((*item_data)->media);
- (*item_data)->media = NULL;
+ media_info_destroy((*item_data)->media);
+ (*item_data)->media = NULL;
}
}
free((*item_data));
mf_warning("ap->category_list = %p", ap->mf_FileOperation.category_list);
mf_warning("ap->recent_list = %p", ap->mf_FileOperation.recent_list);*/
- if (list==ap->mf_FileOperation.search_result_folder_list)
+ if (list == ap->mf_FileOperation.search_result_folder_list) {
ap->mf_FileOperation.search_result_folder_list = NULL;
- if (list==ap->mf_FileOperation.search_result_file_list)
+ }
+ if (list == ap->mf_FileOperation.search_result_file_list) {
ap->mf_FileOperation.search_result_file_list = NULL;
- if (list==ap->mf_FileOperation.folder_list)
+ }
+ if (list == ap->mf_FileOperation.folder_list) {
ap->mf_FileOperation.folder_list = NULL;
- if (list==ap->mf_FileOperation.file_list)
+ }
+ if (list == ap->mf_FileOperation.file_list) {
ap->mf_FileOperation.file_list = NULL;
- if (list==ap->mf_FileOperation.category_list)
+ }
+ if (list == ap->mf_FileOperation.category_list) {
ap->mf_FileOperation.category_list = NULL;
- if (list==ap->mf_FileOperation.recent_list)
+ }
+ if (list == ap->mf_FileOperation.recent_list) {
ap->mf_FileOperation.recent_list = NULL;
+ }
}
static void __mf_util_icu_set_default_timezone_id()
{
- i18n_uchar utimezone_id [MYFILE_ICU_ARR_LENGTH] = {0};
- char timezone_buffer[MYFILE_ICU_ARR_LENGTH] = {0};
- char timezone_id[MYFILE_ICU_ARR_LENGTH] = {0};
- char *buffer = NULL;
- int timezone_str_size;
- int retcode = -1;
-
- retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &buffer);
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- mf_error("[ERR] failed to get the timezone");
+ i18n_uchar utimezone_id [MYFILE_ICU_ARR_LENGTH] = {0};
+ char timezone_buffer[MYFILE_ICU_ARR_LENGTH] = {0};
+ char timezone_id[MYFILE_ICU_ARR_LENGTH] = {0};
+ char *buffer = NULL;
+ int timezone_str_size;
+ int retcode = -1;
+
+ retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, &buffer);
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
+ mf_error("[ERR] failed to get the timezone");
+ }
+ if (buffer) {
+ strncpy(timezone_id, buffer, sizeof(timezone_id) - 1);
+ }
+ timezone_str_size = readlink("/opt/etc/localtime", timezone_buffer, sizeof(timezone_buffer) - 1);
+ SAFE_FREE_CHAR(buffer);
+
+ if (timezone_str_size > 0) {
+ char *ptr, *sp, *zone = NULL, *city = NULL;
+ ptr = strtok_r(timezone_buffer, "/", &sp);
+
+ while ((ptr = strtok_r(NULL, "/", &sp))) {
+ zone = city;
+ city = ptr;
}
- if (buffer)
- strncpy(timezone_id, buffer, sizeof(timezone_id)-1);
- timezone_str_size = readlink("/opt/etc/localtime", timezone_buffer, sizeof(timezone_buffer)-1);
- SAFE_FREE_CHAR(buffer);
-
- if (timezone_str_size > 0) {
- char *ptr, *sp, *zone= NULL, *city= NULL;
- ptr = strtok_r(timezone_buffer, "/", &sp);
-
- while ((ptr = strtok_r(NULL, "/", &sp))) {
- zone = city;
- city = ptr;
- }
-
- if (zone != NULL && city != NULL) {
- if (strcmp("zoneinfo", zone) == 0)
- snprintf(timezone_id, MYFILE_ICU_ARR_LENGTH, "%s", city);
- else
- snprintf(timezone_id, MYFILE_ICU_ARR_LENGTH, "%s/%s", zone, city);
- }
- }
-
- if (*timezone_id) {
- i18n_ustring_copy_ua_n(utimezone_id, timezone_id, sizeof(timezone_buffer)/2);
- retcode = i18n_ucalendar_set_default_timezone(utimezone_id);
- }
+
+ if (zone != NULL && city != NULL) {
+ if (strcmp("zoneinfo", zone) == 0) {
+ snprintf(timezone_id, MYFILE_ICU_ARR_LENGTH, "%s", city);
+ } else {
+ snprintf(timezone_id, MYFILE_ICU_ARR_LENGTH, "%s/%s", zone, city);
+ }
+ }
+ }
+
+ if (*timezone_id) {
+ i18n_ustring_copy_ua_n(utimezone_id, timezone_id, sizeof(timezone_buffer) / 2);
+ retcode = i18n_ucalendar_set_default_timezone(utimezone_id);
+ }
}
int mf_util_icu_init(void *data)
if (find) {
int diff = find - region;
if (diff > 0) {
- region[diff-1] = '\0';
+ region[diff - 1] = '\0';
}
}
}
SAFE_FREE_CHAR(region);
MF_TRACE_END;
return MYFILE_ERR_NONE;
- }
+}
void mf_util_icu_finalize(void *data)
{
int32_t formattedLength;
status = i18n_udate_format_date(ap->mf_Status.formatter, date, formatted, MYFILE_ICU_ARR_LENGTH,
- NULL, &formattedLength);
+ NULL, &formattedLength);
if ((status != I18N_ERROR_NONE) || (formattedLength <= 0)) {
mf_debug("firmatterdLength < 0");
int mf_util_get_pref_value(MYFILE_PREF_TYPE type, int *value)
{
- int ret = MYFILE_ERR_NONE;
- switch (type) {
- case PREF_TYPE_SORT_TYPE:
- {
- ret = preference_get_int(MF_LIST_BY, value);
- if (ret < 0) {
- mf_warning("fail to get list_by value, set it default");
- ret = preference_set_int(MF_LIST_BY, MYFILE_SORT_BY_DATE_R2O);
- *value = MYFILE_SORT_BY_DATE_R2O;
- mf_debug("set int : %d", ret);
- } else {
- if (*value <= MYFILE_SORT_BY_NONE || *value >= MYFILE_SORT_BY_MAX)
- {
- mf_warning("invaild list by type[%d], set it default", *value);
- ret = preference_set_int(MF_LIST_BY, MYFILE_SORT_BY_DATE_R2O);
- mf_debug("set int : %d", ret);
- *value = MYFILE_SORT_BY_DATE_R2O;
- }
- }
- return MYFILE_ERR_NONE;
- }
- break;
-
- case PREF_TYPE_VIEW_STYLE:
- ret = preference_get_int(MF_VIEW_STYLE, value);
- if (ret < 0) {
- mf_warning("fail to get list_by value, set it default");
- ret = preference_set_int(MF_VIEW_STYLE, MF_VIEW_STYLE_LIST);
- *value = MF_VIEW_STYLE_LIST;
- mf_debug("ret %d", ret);
- } else {
- if (*value < MF_VIEW_STYLE_LIST || *value > MF_VIEW_STYLE_THUMBNAIL) {
- mf_warning("invaild list by type[%d], set it default", *value);
- ret = preference_set_int(MF_VIEW_STYLE, MF_VIEW_STYLE_LIST);
- *value = MF_VIEW_STYLE_LIST;
- mf_debug("ret %d", ret);
- }
- }
- break;
-
- case PREF_TYPE_EXTENSION_STATE:
- ret = preference_get_int(MF_EXTENSION_STATE, value);
- if (ret < 0) {
- mf_warning("fail to get list_by value, set it default");
- ret = preference_set_int(MF_EXTENSION_STATE, MF_EXTENSION_SHOW);
- *value = MF_EXTENSION_SHOW;
- mf_debug("ret : %d", ret);
- } else {
- if (*value < MF_EXTENSION_SHOW || *value > MF_EXTENSION_HIDE)
- {
- mf_warning("invaild list by type[%d], set it default", *value);
- ret = preference_set_int(MF_EXTENSION_STATE, MF_EXTENSION_SHOW);
- *value = MF_EXTENSION_SHOW;
- mf_debug("ret : %d", ret);
- }
- }
- break;
- case PREF_TYPE_HIDEN_STATE:
- ret = preference_get_int(MF_HIDDEN_STATE, value);
- if (ret < 0) {
- mf_warning("fail to get list_by value, set it default");
- ret = preference_set_int(MF_HIDDEN_STATE, MF_HIDEN_HIDE);
- *value = MF_HIDEN_HIDE;
- mf_debug("ret : %d", ret);
- } else {
- if (*value < MF_HIDEN_SHOW|| *value > MF_HIDEN_HIDE) {
- mf_warning("invaild list by type[%d], set it default", *value);
- ret = preference_set_int(MF_HIDDEN_STATE, MF_HIDEN_HIDE);
- *value = MF_HIDEN_HIDE;
- mf_debug("ret : %d", ret);
- }
- }
- break;
-
- default:
- mf_debug("No case");
- break;
- }
-
- if (ret != MYFILE_ERR_NONE) {
- ret = MYFILE_ERR_STORAGE_GET_FAILED;
- mf_warning("MYFILE_ERR_STORAGE_GET_FAILED");
- }
-
- return ret;
+ int ret = MYFILE_ERR_NONE;
+ switch (type) {
+ case PREF_TYPE_SORT_TYPE: {
+ ret = preference_get_int(MF_LIST_BY, value);
+ if (ret < 0) {
+ mf_warning("fail to get list_by value, set it default");
+ ret = preference_set_int(MF_LIST_BY, MYFILE_SORT_BY_DATE_R2O);
+ *value = MYFILE_SORT_BY_DATE_R2O;
+ mf_debug("set int : %d", ret);
+ } else {
+ if (*value <= MYFILE_SORT_BY_NONE || *value >= MYFILE_SORT_BY_MAX) {
+ mf_warning("invaild list by type[%d], set it default", *value);
+ ret = preference_set_int(MF_LIST_BY, MYFILE_SORT_BY_DATE_R2O);
+ mf_debug("set int : %d", ret);
+ *value = MYFILE_SORT_BY_DATE_R2O;
+ }
+ }
+ return MYFILE_ERR_NONE;
+ }
+ break;
+
+ case PREF_TYPE_VIEW_STYLE:
+ ret = preference_get_int(MF_VIEW_STYLE, value);
+ if (ret < 0) {
+ mf_warning("fail to get list_by value, set it default");
+ ret = preference_set_int(MF_VIEW_STYLE, MF_VIEW_STYLE_LIST);
+ *value = MF_VIEW_STYLE_LIST;
+ mf_debug("ret %d", ret);
+ } else {
+ if (*value < MF_VIEW_STYLE_LIST || *value > MF_VIEW_STYLE_THUMBNAIL) {
+ mf_warning("invaild list by type[%d], set it default", *value);
+ ret = preference_set_int(MF_VIEW_STYLE, MF_VIEW_STYLE_LIST);
+ *value = MF_VIEW_STYLE_LIST;
+ mf_debug("ret %d", ret);
+ }
+ }
+ break;
+
+ case PREF_TYPE_EXTENSION_STATE:
+ ret = preference_get_int(MF_EXTENSION_STATE, value);
+ if (ret < 0) {
+ mf_warning("fail to get list_by value, set it default");
+ ret = preference_set_int(MF_EXTENSION_STATE, MF_EXTENSION_SHOW);
+ *value = MF_EXTENSION_SHOW;
+ mf_debug("ret : %d", ret);
+ } else {
+ if (*value < MF_EXTENSION_SHOW || *value > MF_EXTENSION_HIDE) {
+ mf_warning("invaild list by type[%d], set it default", *value);
+ ret = preference_set_int(MF_EXTENSION_STATE, MF_EXTENSION_SHOW);
+ *value = MF_EXTENSION_SHOW;
+ mf_debug("ret : %d", ret);
+ }
+ }
+ break;
+ case PREF_TYPE_HIDEN_STATE:
+ ret = preference_get_int(MF_HIDDEN_STATE, value);
+ if (ret < 0) {
+ mf_warning("fail to get list_by value, set it default");
+ ret = preference_set_int(MF_HIDDEN_STATE, MF_HIDEN_HIDE);
+ *value = MF_HIDEN_HIDE;
+ mf_debug("ret : %d", ret);
+ } else {
+ if (*value < MF_HIDEN_SHOW || *value > MF_HIDEN_HIDE) {
+ mf_warning("invaild list by type[%d], set it default", *value);
+ ret = preference_set_int(MF_HIDDEN_STATE, MF_HIDEN_HIDE);
+ *value = MF_HIDEN_HIDE;
+ mf_debug("ret : %d", ret);
+ }
+ }
+ break;
+
+ default:
+ mf_debug("No case");
+ break;
+ }
+
+ if (ret != MYFILE_ERR_NONE) {
+ ret = MYFILE_ERR_STORAGE_GET_FAILED;
+ mf_warning("MYFILE_ERR_STORAGE_GET_FAILED");
+ }
+
+ return ret;
}
void mf_util_set_sort_type(int value)
{
- int ret = -1;
-
- if (value <= MYFILE_SORT_BY_NONE || value >= MYFILE_SORT_BY_MAX)
- {
- ret = preference_set_int(MF_LIST_BY, MYFILE_SORT_BY_DATE_R2O);
- mf_warning("invaild list by type[%d], set it default, %d", value, ret);
- } else {
- ret = preference_set_int(MF_LIST_BY, value);
- mf_debug("value is [%d], [%d]", value, ret);
- }
-
- return;
+ int ret = -1;
+
+ if (value <= MYFILE_SORT_BY_NONE || value >= MYFILE_SORT_BY_MAX) {
+ ret = preference_set_int(MF_LIST_BY, MYFILE_SORT_BY_DATE_R2O);
+ mf_warning("invaild list by type[%d], set it default, %d", value, ret);
+ } else {
+ ret = preference_set_int(MF_LIST_BY, value);
+ mf_debug("value is [%d], [%d]", value, ret);
+ }
+
+ return;
}
void mf_util_set_extension_state(int value)
{
- int ret = -1;
+ int ret = -1;
- if (value <= MF_EXTENSION_NONE || value >= MF_EXTENSION_MAX) {
- ret = preference_set_int(MF_EXTENSION_STATE, MF_EXTENSION_SHOW);
- mf_warning("invaild list by type[%d], set it default : %d", value, ret);
- } else {
- ret = preference_set_int(MF_EXTENSION_STATE, value);
- mf_debug("value is [%d], [%d]", value, ret);
- }
+ if (value <= MF_EXTENSION_NONE || value >= MF_EXTENSION_MAX) {
+ ret = preference_set_int(MF_EXTENSION_STATE, MF_EXTENSION_SHOW);
+ mf_warning("invaild list by type[%d], set it default : %d", value, ret);
+ } else {
+ ret = preference_set_int(MF_EXTENSION_STATE, value);
+ mf_debug("value is [%d], [%d]", value, ret);
+ }
- return;
+ return;
}
void mf_util_set_hiden_state(int value)
{
- int ret = -1;
+ int ret = -1;
- if (value <= MF_HIDEN_NONE || value >= MF_HIDEN_MAX) {
- ret = preference_set_int(MF_HIDDEN_STATE, MF_HIDEN_HIDE);
- mf_warning("invaild hiden by type[%d], set it default : %d", value, ret);
- } else {
- ret = preference_set_int(MF_HIDDEN_STATE, value);
- mf_debug("value is [%d] [%d]", value, ret);
- }
+ if (value <= MF_HIDEN_NONE || value >= MF_HIDEN_MAX) {
+ ret = preference_set_int(MF_HIDDEN_STATE, MF_HIDEN_HIDE);
+ mf_warning("invaild hiden by type[%d], set it default : %d", value, ret);
+ } else {
+ ret = preference_set_int(MF_HIDDEN_STATE, value);
+ mf_debug("value is [%d] [%d]", value, ret);
+ }
- return;
+ return;
}
void mf_util_set_view_style(int value)
{
- int ret = -1;
+ int ret = -1;
- if (value < MF_VIEW_STYLE_LIST || value > MF_VIEW_STYLE_THUMBNAIL) {
- ret = preference_set_int(MF_VIEW_STYLE, MF_VIEW_STYLE_LIST);
- mf_warning("invaild list by type[%d], set it default : %d", value, ret);
- } else {
- ret = preference_set_int(MF_VIEW_STYLE, value);
- mf_debug("value is [%d], [%d]", value, ret);
- }
+ if (value < MF_VIEW_STYLE_LIST || value > MF_VIEW_STYLE_THUMBNAIL) {
+ ret = preference_set_int(MF_VIEW_STYLE, MF_VIEW_STYLE_LIST);
+ mf_warning("invaild list by type[%d], set it default : %d", value, ret);
+ } else {
+ ret = preference_set_int(MF_VIEW_STYLE, value);
+ mf_debug("value is [%d], [%d]", value, ret);
+ }
- return;
+ return;
}
void mf_util_set_recent_file(char *path)
{
- if (path == NULL) {
- mf_debug("path NULL");
- return;
- }
+ if (path == NULL) {
+ mf_debug("path NULL");
+ return;
+ }
- int ret = -1;
- ret = preference_set_string(MF_RECENT_FILE, path);
- mf_debug("ret is [%d]", ret);
+ int ret = -1;
+ ret = preference_set_string(MF_RECENT_FILE, path);
+ mf_debug("ret is [%d]", ret);
- return;
+ return;
}
bool mf_util_db_get_recent_files_cb(MFRitem *Ritem, void *user_data)
{
struct appdata *ap = (struct appdata *)user_data;
if (Ritem && Ritem->path) {
- SECURE_ERROR("Ritem->path is [%s]mf_file_exists is [%d] access(dst_dir, R_OK | W_OK) is [%d] ",Ritem->path, mf_file_exists(Ritem->path), access(Ritem->path, R_OK | W_OK));
+ SECURE_ERROR("Ritem->path is [%s]mf_file_exists is [%d] access(dst_dir, R_OK | W_OK) is [%d] ", Ritem->path, mf_file_exists(Ritem->path), access(Ritem->path, R_OK | W_OK));
if (mf_file_exists(Ritem->path)) {
mf_util_generate_list_prepend(&ap->mf_FileOperation.recent_list, g_strdup(Ritem->path), FILE_TYPE_ETC, mf_list_recent_files);
} else {
case MORE_DATA_COPYING:
ap->mf_Status.more = MORE_INTERNAL_COPY;
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT, NULL,
- MF_MSG_COPY_FAILED2, NULL, NULL, NULL, (Evas_Smart_Cb)mf_callback_exception_popup_cb, ap);
+ MF_MSG_COPY_FAILED2, NULL, NULL, NULL, (Evas_Smart_Cb)mf_callback_exception_popup_cb, ap);
break;
case MORE_DATA_MOVING:
ap->mf_Status.more = MORE_INTERNAL_MOVE;
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT, NULL,
- MF_MSG_MOVE_FAILED3, NULL, NULL, NULL, (Evas_Smart_Cb)mf_callback_exception_popup_cb, ap);
+ MF_MSG_MOVE_FAILED3, NULL, NULL, NULL, (Evas_Smart_Cb)mf_callback_exception_popup_cb, ap);
break;
case MORE_DELETE:
ap->mf_Status.more = MORE_DEFAULT;
void mf_util_set_pm_lock(void *data, Eina_Bool isLock)
{
- MF_TRACE_BEGIN;
- mf_retm_if(data == NULL, "data is NULL");
-
- int ret = -1;
- struct appdata *ap = (struct appdata *)data;
-
- if (ap->mf_Status.flagLCDLock != isLock) {
- if (ap->mf_Status.flagLCDLock == EINA_TRUE) {
- ap->mf_Status.flagLCDLock = EINA_FALSE;
- } else {
- ap->mf_Status.flagLCDLock = EINA_TRUE;
- }
-
- if (ap->mf_Status.flagLCDLock) {
- mf_debug("lock the LCD_OFF");
- ret = device_power_request_lock(POWER_LOCK_CPU, 0);
- } else {
- mf_debug("unlock the LCD_OFF");
- ret = device_power_release_lock(POWER_LOCK_CPU);
- }
-
- if (ret != 0)
- mf_debug("fail to lock(unlock)");
- }
- MF_TRACE_END;
+ MF_TRACE_BEGIN;
+ mf_retm_if(data == NULL, "data is NULL");
+
+ int ret = -1;
+ struct appdata *ap = (struct appdata *)data;
+
+ if (ap->mf_Status.flagLCDLock != isLock) {
+ if (ap->mf_Status.flagLCDLock == EINA_TRUE) {
+ ap->mf_Status.flagLCDLock = EINA_FALSE;
+ } else {
+ ap->mf_Status.flagLCDLock = EINA_TRUE;
+ }
+
+ if (ap->mf_Status.flagLCDLock) {
+ mf_debug("lock the LCD_OFF");
+ ret = device_power_request_lock(POWER_LOCK_CPU, 0);
+ } else {
+ mf_debug("unlock the LCD_OFF");
+ ret = device_power_release_lock(POWER_LOCK_CPU);
+ }
+
+ if (ret != 0) {
+ mf_debug("fail to lock(unlock)");
+ }
+ }
+ MF_TRACE_END;
}
long mf_util_character_count_get(const char *original)
mf_retvm_if(original == NULL, 0, "input string is NULL");
long count = 0;
char *utf8_form = g_locale_to_utf8(original, -1, NULL, NULL, NULL);
- if (utf8_form == NULL)
+ if (utf8_form == NULL) {
+ return count;
+ } else {
+ count = g_utf8_strlen(utf8_form, -1);
+ free(utf8_form);
+ mf_debug("utf8 count is %ld", count);
return count;
- else {
- count = g_utf8_strlen(utf8_form, -1);
- free(utf8_form);
- mf_debug("utf8 count is %ld", count);
- return count;
}
}
mf_debug("source_path is [%s] path is [%s]", source_path->str, path->str);
if (g_strcmp0(source_path->str, path->str) == 0) {
flag = TRUE;
- mf_debug("flag is [%d]source_path is [%s] path is [%s]",flag, source_path->str, path->str);
+ mf_debug("flag is [%d]source_path is [%s] path is [%s]", flag, source_path->str, path->str);
*source = eina_list_remove(*source, source_path);
g_string_free(source_path, TRUE);
source_path = NULL;
return flag;
}
-int mf_util_generate_list_data(const char *path, Eina_List **dir_list ,Eina_List ** file_list)
+int mf_util_generate_list_data(const char *path, Eina_List **dir_list , Eina_List ** file_list)
{
MF_TRACE_BEGIN;
mf_retvm_if(path == NULL, 0, "input path is NULL");
Eina_List *dir_list = NULL;
int error_code = 0;
- mf_retvm_if (ap->mf_Status.path == NULL, MYFILE_ERR_INVALID_ARG, "ap->mf_Status.path is NULL");
- mf_retvm_if (ap->mf_Status.path->str == NULL, MYFILE_ERR_INVALID_ARG, "ap->mf_Status.path->str is NULL");
+ mf_retvm_if(ap->mf_Status.path == NULL, MYFILE_ERR_INVALID_ARG, "ap->mf_Status.path is NULL");
+ mf_retvm_if(ap->mf_Status.path->str == NULL, MYFILE_ERR_INVALID_ARG, "ap->mf_Status.path->str is NULL");
error_code = mf_util_generate_list_data(ap->mf_Status.path->str, &dir_list, &file_list);
if (error_code != MYFILE_ERR_NONE) {
mf_retvm_if(data == NULL, 0, "data is null");
pNode = (fsNodeInfo *) malloc(sizeof(fsNodeInfo));
- if (pNode == NULL)
+ if (pNode == NULL) {
return 0;
+ }
/*set path */
memset(pNode, 0, sizeof(fsNodeInfo));
/*need to sort folder items only By Name and Date*/
if (iSortTypeValue == MYFILE_SORT_BY_NAME_A2Z || iSortTypeValue == MYFILE_SORT_BY_NAME_Z2A || iSortTypeValue == MYFILE_SORT_BY_DATE_R2O
- || iSortTypeValue == MYFILE_SORT_BY_DATE_O2R) {
+ || iSortTypeValue == MYFILE_SORT_BY_DATE_O2R) {
mf_fs_oper_sort_list(&ap->mf_FileOperation.folder_list, iSortTypeValue);
} else {
mf_fs_oper_sort_list(&ap->mf_FileOperation.folder_list, MYFILE_SORT_BY_NAME_A2Z);
int i = 0;
bool found = false;
gchar *markup_text_start = NULL;
- gchar *markup_text_end= NULL;
- gchar *markup_text= NULL;
+ gchar *markup_text_end = NULL;
+ gchar *markup_text = NULL;
int r = 222;
int g = 111;
mf_retvm_if(result == NULL, NULL, "result is NULL");
char *translate_keyword = elm_entry_markup_to_utf8(searchword);
- if (g_utf8_validate(string,-1,NULL)) {
+ if (g_utf8_validate(string, -1, NULL)) {
strncpy(pstr, string, DEF_BUF_LEN);
word_len = strlen(pstr);
}
*result = found;
- memset(return_string, 0x00, DEF_BUF_LEN+1);
+ memset(return_string, 0x00, DEF_BUF_LEN + 1);
bool is_valid_length = ((i + search_len) <= word_len);//Fixed P131112-02074
if (found && is_valid_length) {
if (i == 0) {
markup_text = g_markup_escape_text(&pstr[0], search_len);
- markup_text_end = g_markup_escape_text(&pstr[search_len], word_len-search_len);
+ markup_text_end = g_markup_escape_text(&pstr[search_len], word_len - search_len);
mf_retvm_if(markup_text == NULL, NULL, "markup_text is NULL");
mf_retvm_if(markup_text_end == NULL, NULL, "markup_text_end is NULL");
markup_text_start = g_markup_escape_text(&pstr[0], i);
markup_text = g_markup_escape_text(&pstr[i], search_len);
- markup_text_end = g_markup_escape_text(&pstr[i+search_len], word_len-(i+search_len));
+ markup_text_end = g_markup_escape_text(&pstr[i + search_len], word_len - (i + search_len));
mf_retvm_if(markup_text_start == NULL, NULL, "markup_text_start is NULL");
mf_retvm_if(markup_text == NULL, NULL, "markup_text is NULL");
mf_retvm_if(markup_text_end == NULL, NULL, "markup_text_end is NULL");
MF_CHECK_NULL(ID);
char *str;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
str = dgettext("sys_string", ID);
- else
+ } else {
str = gettext(ID);
+ }
return str;
}
void mf_util_free_data(void **data, int type)
{
switch (type) {
- case MYFILE_TYPE_FSNODE:
- {
+ case MYFILE_TYPE_FSNODE: {
if (*data != NULL) {
SAFE_FREE_CHAR(((fsNodeInfo *)(*data))->path);
SAFE_FREE_CHAR(((fsNodeInfo *)(*data))->name);
*data = NULL;
}
}
- break;
- case MYFILE_TYPE_ITEM_DATA:
- {
+ break;
+ case MYFILE_TYPE_ITEM_DATA: {
if (*data != NULL) {
SAFE_FREE_GSTRING(((mfItemData_s *)(*data))->m_ItemName);
SAFE_FREE_CHAR(((mfItemData_s *)(*data))->size);
*data = NULL;
}
}
- break;
+ break;
default:
break;
}
static void *func_params = NULL;
typedef enum {
- MF_TABLE_NONE = -1,
- MF_TABLE_RECENT_FILES,
- MF_TABLE_NUM,
+ MF_TABLE_NONE = -1,
+ MF_TABLE_RECENT_FILES,
+ MF_TABLE_NUM,
} mf_tbl_name_e;
typedef enum {
- MF_FIELD_RECENT_FILES_NONE = -1,
- MF_FIELD_RECENT_FILES_PATH,
- MF_FIELD_RECENT_FILES_NAME,
- MF_FIELD_RECENT_FILES_STORAGE_TYPE,
- MF_FIELD_RECENT_FILES_THUMBNAIL,
- MF_FIELD_RECENT_FILES_NUM,
+ MF_FIELD_RECENT_FILES_NONE = -1,
+ MF_FIELD_RECENT_FILES_PATH,
+ MF_FIELD_RECENT_FILES_NAME,
+ MF_FIELD_RECENT_FILES_STORAGE_TYPE,
+ MF_FIELD_RECENT_FILES_THUMBNAIL,
+ MF_FIELD_RECENT_FILES_NUM,
} mf_field_recent_files_e;
typedef struct {
- char *field_name;
- char *field_type;
+ char *field_name;
+ char *field_type;
} mf_tbl_field_s;
typedef struct {
char *table_name;
- mf_tbl_field_s mf_tbl_field[MF_FIELD_RECENT_FILES_NUM+1];
+ mf_tbl_field_s mf_tbl_field[MF_FIELD_RECENT_FILES_NUM + 1];
} mf_tbl_s;
-mf_tbl_s mf_tbl[MF_TABLE_NUM] =
-{
- {"recent_files",
- {
- {"path", ""} /* PK */
- ,
- {"name", ""}
- ,
- {"storage_type", ""}
- ,
- {"thumbnail_path", ""}
- }
- }
+mf_tbl_s mf_tbl[MF_TABLE_NUM] = {
+ {
+ "recent_files",
+ {
+ {"path", ""} /* PK */
+ ,
+ {"name", ""}
+ ,
+ {"storage_type", ""}
+ ,
+ {"thumbnail_path", ""}
+ }
+ }
};
static int __mf_busy_handler(void *pData, int count)
}
int mf_sqlite3_exec(sqlite3 *p_db, /* An open database */
- const char *sql, /* SQL to be evaluated */
- int (*callback)(void*,int,char**,char**), /* Callback function */
- void * params, /* 1st argument to callback */
- char **errmsg) /* Error msg written here */
+ const char *sql, /* SQL to be evaluated */
+ int (*callback)(void*, int, char**, char**), /* Callback function */
+ void * params, /* 1st argument to callback */
+ char **errmsg) /* Error msg written here */
{
mf_debug("mf_sqlite3_exec enter\n");
sqlite3_stmt* p_statement = NULL;
if (SQLITE_OK != mf_sqlite3_exec(handle, "COMMIT;", sqlite3_func, func_params, &err_msg)) {
if (err_msg) {
mf_debug("Error:failed to end transaction: error=%s\n",
- err_msg);
+ err_msg);
sqlite3_free(err_msg);
}
return MFD_ERROR_DB_INTERNAL;
}
- if (err_msg)
+ if (err_msg) {
sqlite3_free(err_msg);
+ }
mf_debug("gm_sqlite3_commit_trans leave\n");
return 0;
}
{
assert(NULL != stmt);
- if (str)
+ if (str) {
return sqlite3_bind_text(stmt, pos, (const char*)str, strlen(str), SQLITE_STATIC);
- else
+ } else {
return sqlite3_bind_null(stmt, pos);
+ }
}
static int __mf_query_bind_int(sqlite3_stmt *stmt, int pos, int num)
static void __mf_data_to_text(char *textbuf, char **output)
{
- if (textbuf && strlen(textbuf)>0) {
+ if (textbuf && strlen(textbuf) > 0) {
if (*output) {
free(*output);
*output = NULL;
return MFD_ERROR_DB_INTERNAL;
}
- if (err_msg)
+ if (err_msg) {
sqlite3_free(err_msg);
+ }
mf_debug("query success\n");
return err;
mf_debug("gm_sqlite3_begin_trans enter\n");
if (SQLITE_OK !=
- mf_sqlite3_exec(handle, "BEGIN IMMEDIATE;", NULL, NULL, &err_msg)) {
- if (err_msg) {
+ mf_sqlite3_exec(handle, "BEGIN IMMEDIATE;", NULL, NULL, &err_msg)) {
+ if (err_msg) {
mf_debug("Error:failed to begin transaction: error=%s\n",
- err_msg);
+ err_msg);
sqlite3_free(err_msg);
- }
+ }
return MFD_ERROR_DB_INTERNAL;
}
- if (err_msg)
+ if (err_msg) {
sqlite3_free(err_msg);
+ }
mf_debug("gm_sqlite3_begin_trans leave\n");
return 0;
}
mf_debug("gm_sqlite3_rollback_trans enter\n");
if (SQLITE_OK !=
- mf_sqlite3_exec(handle, "ROLLBACK;", NULL, NULL, &err_msg)) {
- if (err_msg) {
+ mf_sqlite3_exec(handle, "ROLLBACK;", NULL, NULL, &err_msg)) {
+ if (err_msg) {
mf_debug("Error:failed to rollback transaction: error=%s\n",
- err_msg);
+ err_msg);
sqlite3_free(err_msg);
- }
+ }
return MFD_ERROR_DB_INTERNAL;
}
- if (err_msg)
+ if (err_msg) {
sqlite3_free(err_msg);
+ }
mf_debug("gm_sqlite3_rollback_trans leave\n");
return 0;
}
MFRitem *ritem = NULL;
ritem = (MFRitem *)iter->data;
- if (callback(ritem, user_data) == FALSE)
+ if (callback(ritem, user_data) == FALSE) {
break;
+ }
}
}
mf_destroy_recent_files_item(data);
}
-static void __mf_media_db_eina_list_free_full(Eina_List **list, void (*func)(void *data)) {
+static void __mf_media_db_eina_list_free_full(Eina_List **list, void (*func)(void *data))
+{
mf_retm_if(*list == NULL, "list is NULL");
void *pNode = NULL;
return MFD_ERROR_NONE;
}
-int mf_insert_recent_file(MFDHandle *mfd_handle, const char *path, const char *name, int storage_type,
+int mf_insert_recent_file(MFDHandle *mfd_handle, const char *path, const char *name, int storage_type,
const char *thumbnail_path)
{
mf_debug("");
- mf_retvm_if (path == NULL, MFD_ERROR_INVALID_PARAMETER, "path is NULL");
+ mf_retvm_if(path == NULL, MFD_ERROR_INVALID_PARAMETER, "path is NULL");
//mf_retvm_if (thumbnail_path == NULL, MFD_ERROR_INVALID_PARAMETER, "path is NULL");
sqlite3_stmt *stmt = NULL;
mf_tbl_field = mf_tbl[field_seq].mf_tbl_field;
snprintf(query_string, sizeof(query_string), MF_INSERT_INTO_RECENT_FILES_TABLE,
- mf_tbl[field_seq].table_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_NAME].field_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_STORAGE_TYPE].field_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_THUMBNAIL].field_name);
+ mf_tbl[field_seq].table_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_NAME].field_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_STORAGE_TYPE].field_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_THUMBNAIL].field_name);
err = sqlite3_prepare_v2(mfd_handle, query_string, strlen(query_string), &stmt, NULL);
if (err != SQLITE_OK) {
query_string =
sqlite3_mprintf(MF_DELETE_FROM_RECENT_FILES_TABLE,
- mf_tbl[field_seq].table_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
- path);
+ mf_tbl[field_seq].table_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
+ path);
mf_debug("Query : %s", query_string);
query_string =
sqlite3_mprintf(MF_DELETE_BY_TYPE_FROM_RECENT_FILES_TABLE,
- mf_tbl[field_seq].table_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_STORAGE_TYPE].field_name,
- storage_type);
+ mf_tbl[field_seq].table_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_STORAGE_TYPE].field_name,
+ storage_type);
mf_debug("Query : %s", query_string);
query_string =
sqlite3_mprintf(MF_UPDATE_SET_RECENT_FILES_TABLE,
- mf_tbl[field_seq].table_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_THUMBNAIL].field_name,
- new_thumbnail,
- mf_tbl_field[MF_FIELD_RECENT_FILES_THUMBNAIL].field_name,
- thumbnail);
+ mf_tbl[field_seq].table_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_THUMBNAIL].field_name,
+ new_thumbnail,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_THUMBNAIL].field_name,
+ thumbnail);
mf_debug("Query : %s", query_string);
}
-int mf_update_recent_files_name(MFDHandle *mfd_handle,const char *new_name, char *old_name)
+int mf_update_recent_files_name(MFDHandle *mfd_handle, const char *new_name, char *old_name)
{
if (new_name == NULL) {
mf_debug("device_id is null");
query_string =
sqlite3_mprintf(MF_UPDATE_SET_RECENT_FILES_TABLE,
- mf_tbl[field_seq].table_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
- new_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
- old_name);
+ mf_tbl[field_seq].table_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
+ new_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
+ old_name);
mf_error("Query : %s", query_string);
}
Eina_List *recent_files_list = NULL;
- MFRitem *ritem= NULL;
+ MFRitem *ritem = NULL;
while (SQLITE_ROW == rc) {
ritem = (MFRitem *)calloc(1, sizeof(MFRitem));
int rc = 0;
int find = 0;
query_string = sqlite3_mprintf(MF_SELECT_FROM_RECENT_FILE_TABLE,
- mf_tbl[field_seq].table_name,
- mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
- path);
+ mf_tbl[field_seq].table_name,
+ mf_tbl_field[MF_FIELD_RECENT_FILES_PATH].field_name,
+ path);
mf_error("Query : %s", query_string);
}
ret = mf_insert_recent_file(mfd_handle, path, name, storage_type, thumbnail_path);
- if (ret != MFD_ERROR_NONE) {
+ if (ret != MFD_ERROR_NONE) {
mf_debug("insert content info into folder table failed");
return ret;
}
}
ret = mf_delete_recent_files(mfd_handle, path);
- if (ret != MFD_ERROR_NONE) {
+ if (ret != MFD_ERROR_NONE) {
mf_debug("delete device info into devices table failed");
return ret;
}
}
ret = mf_delete_recent_files_by_type(mfd_handle, storage_type);
- if (ret != MFD_ERROR_NONE) {
+ if (ret != MFD_ERROR_NONE) {
mf_debug("delete device info into devices table failed");
return ret;
}
}
ret = mf_update_recent_files_thumbnail(mfd_handle, thumbnail, new_thumbnail);
- if (ret != MFD_ERROR_NONE) {
+ if (ret != MFD_ERROR_NONE) {
mf_debug
- ("update device icon failed");
+ ("update device icon failed");
return ret;
}
}
ret = mf_foreach_recent_files_list(mfd_handle, callback, user_data);
- if (ret != MFD_ERROR_NONE && ret != MFD_ERROR_DB_NO_RECORD) {
+ if (ret != MFD_ERROR_NONE && ret != MFD_ERROR_DB_NO_RECORD) {
mf_debug("foreach content list fail");
return ret;
}
}
ret = mf_get_recent_files_count(mfd_handle, count);
- if (ret != MFD_ERROR_NONE && ret != MFD_ERROR_DB_NO_RECORD) {
+ if (ret != MFD_ERROR_NONE && ret != MFD_ERROR_DB_NO_RECORD) {
mf_debug
- ("foreach content list fail");
+ ("foreach content list fail");
return ret;
}
SAFE_FREE_ECORE_EVENT(ap->mf_MainWindow.event);
ap->mf_MainWindow.event = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
- (Ecore_Event_Handler_Cb)mf_context_popup_mousedown_cb, ap);
+ (Ecore_Event_Handler_Cb)mf_context_popup_mousedown_cb, ap);
mf_callback_set_mmc_state_cb(ap);
ap->mf_Status.app_init_idler = NULL;
//mf_callback_imf_state_callback_register(ap);
-/*** Add the media-db update callback ***********/
+ /*** Add the media-db update callback ***********/
media_content_set_db_updated_cb(mf_category_list_update_cb, ap);
mf_file_recursive_rm(TEMP_FOLDER_FOR_COPY_PHONE);
mf_file_recursive_rm(TEMP_FOLDER_FOR_COPY_MMC);
RAISE_WIN:
-/**************pre-condition test to launch myfile app******************/
+ /**************pre-condition test to launch myfile app******************/
MF_TRACE_END;
t_end;
{
MF_TRACE_BEGIN;
mf_retm_if(win == NULL, "win is NULL");
- if (elm_win_wm_rotation_supported_get(win))
- {
+ if (elm_win_wm_rotation_supported_get(win)) {
const int rots[4] = { 0, 90, 180, 270 };
elm_win_wm_rotation_available_rotations_set(win, rots, 4);
}
pthread_t thread_extra;
pthread_attr_t attr;
pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (initialization_done_extra != 1) {
- pthread_create(&thread_extra,&attr,initialization_extra,data);
- initialization_done_extra=1;
+ pthread_create(&thread_extra, &attr, initialization_extra, data);
+ initialization_done_extra = 1;
}
}
elm_object_content_set(ap->mf_MainWindow.pConformant, ap->mf_MainWindow.pMainLayout);
elm_win_conformant_set(ap->mf_MainWindow.pWindow, EINA_TRUE);
- //recover indicator mode and type when your view disappeared.
+ //recover indicator mode and type when your view disappeared.
elm_win_indicator_mode_set(ap->mf_MainWindow.pWindow, ELM_WIN_INDICATOR_SHOW);
elm_win_indicator_opacity_set(ap->mf_MainWindow.pWindow, ELM_WIN_INDICATOR_TRANSPARENT);
elm_object_signal_emit(ap->mf_MainWindow.pConformant, "elm,state,indicator,overlap", "");
struct appdata *ap = (struct appdata *)data;
- app_control_get_extra_data (service, "path", &ap->mf_Bundle.path);
- app_control_get_extra_data (service, "select_type", &ap->mf_Bundle.select_type);
- app_control_get_extra_data (service, "file_type", &ap->mf_Bundle.file_type);
- app_control_get_extra_data (service, "marked_mode", &ap->mf_Bundle.marked_mode);
+ app_control_get_extra_data(service, "path", &ap->mf_Bundle.path);
+ app_control_get_extra_data(service, "select_type", &ap->mf_Bundle.select_type);
+ app_control_get_extra_data(service, "file_type", &ap->mf_Bundle.file_type);
+ app_control_get_extra_data(service, "marked_mode", &ap->mf_Bundle.marked_mode);
MF_TRACE_END;
t_end;
}
char *tmp = NULL;
mf_error();
char *operation = NULL;
-
+
app_control_get_operation(app_control, &operation);
mf_error("operation is [%s]", operation);
if (g_strcmp0(operation, APP_CONTROL_OPERATION_PICK) == 0) {
SAFE_DEL_NAVI_ITEM(&ap->mf_Status.pPreNaviItem);
//run_extra(data);
} else {
- if (ap->mf_MainWindow.pWindow != NULL && ap->mf_Status.b_run_background)
- {
+ if (ap->mf_MainWindow.pWindow != NULL && ap->mf_Status.b_run_background) {
if (mf_util_is_rotation_lock() == 0) {
mf_debug("rotation is locked");
if (ap->mf_Status.rotation_type == MF_ROTATE_PORTRAIT) {
run_extra(data);
SAFE_FREE_CHAR(uri);
} else {
- if (ap->mf_MainWindow.pWindow != NULL && ap->mf_Status.b_run_background)
- {
+ if (ap->mf_MainWindow.pWindow != NULL && ap->mf_Status.b_run_background) {
if (mf_util_is_rotation_lock() == 0) {
mf_debug("rotation is locked");
if (ap->mf_Status.rotation_type == MF_ROTATE_PORTRAIT) {
run_extra(data);
}
}
- SAFE_FREE_CHAR(tmp);
+ SAFE_FREE_CHAR(tmp);
}
if (ap->mf_MainWindow.pWindow) {
evas_object_show(ap->mf_MainWindow.pWindow);
if (mf_view_is_operating(ap)) {
mf_callback_progress_bar_cancel_cb(ap, NULL, NULL);
}
-
+
mf_media_content_disconnect();
SAFE_FREE_OBJ(ap->mf_MainWindow.pProgressPopup);
media_content_unset_db_updated_cb();
mf_category_list_destory();
mf_callback_unregister_mmc_state_cb();
- if (ap->mf_Status.search_handler)
+ if (ap->mf_Status.search_handler) {
mf_search_finalize(&ap->mf_Status.search_handler);
+ }
mf_edit_folder_list_clear();
mf_edit_file_list_clear();
mf_log_finalize();
#endif
- if (ap->mf_Status.flagIcuInit == TRUE)
+ if (ap->mf_Status.flagIcuInit == TRUE) {
mf_util_icu_finalize(ap);
+ }
if (ap->mf_FileOperation.sync_pipe) {
ecore_pipe_del(ap->mf_FileOperation.sync_pipe);
mf_util_set_pm_lock(ap, EINA_FALSE);
- elm_theme_extension_del(NULL, EDJ_NAME);
+ elm_theme_extension_del(NULL, EDJ_NAME);
t_end;
MF_TRACE_END;
int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- mf_error("[ERR] failed to get the language");
+ mf_error("[ERR] failed to get the language");
}
if (locale) {
ap->mf_MainWindow.pLongpressPopup = NULL;
}
if (ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_COMPRESS
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_EDIT_DELETE_RECENT
- || ap->mf_Status.more == MORE_EDIT_UNINSTALL
-
- || (mf_view_get_pre_state(ap) == MORE_EDIT && ap->mf_Status.more == MORE_RENAME)) {
+ || ap->mf_Status.more == MORE_SHARE_EDIT
+ || ap->mf_Status.more == MORE_COMPRESS
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_EDIT_DELETE_RECENT
+ || ap->mf_Status.more == MORE_EDIT_UNINSTALL
+
+ || (mf_view_get_pre_state(ap) == MORE_EDIT && ap->mf_Status.more == MORE_RENAME)) {
char *label = NULL;
int count = mf_edit_file_count_get();
#ifdef MYFILE_CRITICAL_LOG
ret = mf_log_init();
- if (ret != MYFILE_ERR_NONE)
+ if (ret != MYFILE_ERR_NONE) {
mf_debug("initialize critical log failed");
+ }
#endif
memset(&ops, 0x0, sizeof(ui_app_lifecycle_callback_s));
memset(&ad, 0x0, sizeof(struct appdata));
#define MF_THUMBNAIL_DEBUG mf_debug
char *thumb_request_id = NULL;
-typedef struct _ThumbGen
-{
- char *szMediaURL;
- bool bIsRealize;
+typedef struct _ThumbGen {
+ char *szMediaURL;
+ bool bIsRealize;
- char *szSaveDir;
- bool bIsStart;
- bool bIscancel;
- void *pUserData;
+ char *szSaveDir;
+ bool bIsStart;
+ bool bIscancel;
+ void *pUserData;
- mf_thumb_gen_progress_cb progress_cb;
- mf_thumb_gen_complete_cb complete_cb;
- mf_thumb_gen_cancel_cb cancel_cb;
+ mf_thumb_gen_progress_cb progress_cb;
+ mf_thumb_gen_complete_cb complete_cb;
+ mf_thumb_gen_cancel_cb cancel_cb;
- Eina_List * file_list;
+ Eina_List * file_list;
} ThumbGen;
static int myfile_thumb_update_filelist(ThumbGen *pThumbGen)
{
- if (pThumbGen == NULL) {
- return 0;
- }
-
- _mf_thumb_gen_lock();
- if (pThumbGen->bIsRealize == FALSE) {
- mf_debug(" == pThumbGen->bIsRealize is Fail ==");
- _mf_thumb_gen_unlock();
- return 0;
- }
-
- _mf_thumb_gen_unlock();
- mf_retvm_if(pThumbGen->file_list == NULL, MYFILE_ERR_INVALID_ARG, "pThumbGen->file_list is null");
-
- fsNodeInfo *pNode = NULL;
- Eina_List *l = NULL;
- int i = 0;
- char *path = pThumbGen->szMediaURL;
- Eina_List *file_list = pThumbGen->file_list;
- Eina_List *list_tmp = file_list;
- int file_count = eina_list_count(file_list) ;
-
- thumbnail_h thumb_handle;
- while (true)
- {
- list_tmp = file_list->prev;
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>list_tmp = %p", list_tmp);
- if (list_tmp == NULL)
- break;
- else
- file_list = file_list->prev;
- }
-
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>path = %s", path);
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>file_list = %x", pThumbGen->file_list);
- MF_THUMBNAIL_DEBUG("\nfile count is [%d]", file_count);
-
- EINA_LIST_FOREACH(file_list, l, pNode) {
- if (pNode) {
- //Make thumbnail begining............................
- if (pThumbGen->bIscancel == true) {
- goto EXIT;
- }
-
- if (pNode != NULL && pNode->name != NULL && pNode->path != NULL)
- {
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->path = %s, pNode->name=%s", pNode->path, pNode->name);
-
- switch (pNode->type)
- {
- case FILE_TYPE_IMAGE:
- case FILE_TYPE_VIDEO:
- {
- if (mf_util_is_low_memory(PHONE_FOLDER, MF_STORAGE_SIZE_MIN)) {
- goto EXIT;
- }
-
- pNode->thumbnail_path = calloc(1, sizeof(char) * MF_FILE_NAME_MAX_LENGTH);
- if (pNode->thumbnail_path != NULL) {
- MF_THUMBNAIL_DEBUG("\n>>>>>1");
- snprintf(pNode->thumbnail_path, MF_FILE_NAME_MAX_LENGTH - 1, MF_THUMB_FILE_NAME_STR, pNode->name);
- MF_THUMBNAIL_DEBUG("\n>>>>>2");
- char tmp_path[MF_FILE_NAME_MAX_LENGTH + 1] = {0};
- MF_THUMBNAIL_DEBUG("\n>>>>>3");
- snprintf(tmp_path, MF_FILE_NAME_MAX_LENGTH - 1, "%s/%s", pNode->path, pNode->name);
- MF_THUMBNAIL_DEBUG("\n>>>>>4");
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->thumbnail_path1 = %s", pNode->thumbnail_path);
- thumbnail_util_create(&thumb_handle);
- if (thumb_handle) {
- thumbnail_util_set_path(thumb_handle, tmp_path);
- int ret = thumbnail_util_extract(thumb_handle, _mf_thumbnail_completed_cb, pNode, &thumb_request_id);
- //int ret = thumbnail_request_save_to_file(tmp_path, pNode->thumbnail_path);
- if (ret == THUMBNAIL_UTIL_ERROR_NONE) {
- mf_thumb_gen_progress_cb func = pThumbGen->progress_cb;
- if (func && pThumbGen->bIscancel == false) {
- func(true, i, pNode);
- } else {
- goto EXIT;
- }
+ if (pThumbGen == NULL) {
+ return 0;
+ }
+
+ _mf_thumb_gen_lock();
+ if (pThumbGen->bIsRealize == FALSE) {
+ mf_debug(" == pThumbGen->bIsRealize is Fail ==");
+ _mf_thumb_gen_unlock();
+ return 0;
+ }
+
+ _mf_thumb_gen_unlock();
+ mf_retvm_if(pThumbGen->file_list == NULL, MYFILE_ERR_INVALID_ARG, "pThumbGen->file_list is null");
+
+ fsNodeInfo *pNode = NULL;
+ Eina_List *l = NULL;
+ int i = 0;
+ char *path = pThumbGen->szMediaURL;
+ Eina_List *file_list = pThumbGen->file_list;
+ Eina_List *list_tmp = file_list;
+ int file_count = eina_list_count(file_list) ;
+
+ thumbnail_h thumb_handle;
+ while (true) {
+ list_tmp = file_list->prev;
+ MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>list_tmp = %p", list_tmp);
+ if (list_tmp == NULL) {
+ break;
+ } else {
+ file_list = file_list->prev;
+ }
+ }
+
+ MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>path = %s", path);
+ MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>file_list = %x", pThumbGen->file_list);
+ MF_THUMBNAIL_DEBUG("\nfile count is [%d]", file_count);
+
+ EINA_LIST_FOREACH(file_list, l, pNode) {
+ if (pNode) {
+ //Make thumbnail begining............................
+ if (pThumbGen->bIscancel == true) {
+ goto EXIT;
+ }
+
+ if (pNode != NULL && pNode->name != NULL && pNode->path != NULL) {
+ MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->path = %s, pNode->name=%s", pNode->path, pNode->name);
+
+ switch (pNode->type) {
+ case FILE_TYPE_IMAGE:
+ case FILE_TYPE_VIDEO: {
+ if (mf_util_is_low_memory(PHONE_FOLDER, MF_STORAGE_SIZE_MIN)) {
+ goto EXIT;
+ }
+
+ pNode->thumbnail_path = calloc(1, sizeof(char) * MF_FILE_NAME_MAX_LENGTH);
+ if (pNode->thumbnail_path != NULL) {
+ MF_THUMBNAIL_DEBUG("\n>>>>>1");
+ snprintf(pNode->thumbnail_path, MF_FILE_NAME_MAX_LENGTH - 1, MF_THUMB_FILE_NAME_STR, pNode->name);
+ MF_THUMBNAIL_DEBUG("\n>>>>>2");
+ char tmp_path[MF_FILE_NAME_MAX_LENGTH + 1] = {0};
+ MF_THUMBNAIL_DEBUG("\n>>>>>3");
+ snprintf(tmp_path, MF_FILE_NAME_MAX_LENGTH - 1, "%s/%s", pNode->path, pNode->name);
+ MF_THUMBNAIL_DEBUG("\n>>>>>4");
+ MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->thumbnail_path1 = %s", pNode->thumbnail_path);
+ thumbnail_util_create(&thumb_handle);
+ if (thumb_handle) {
+ thumbnail_util_set_path(thumb_handle, tmp_path);
+ int ret = thumbnail_util_extract(thumb_handle, _mf_thumbnail_completed_cb, pNode, &thumb_request_id);
+ //int ret = thumbnail_request_save_to_file(tmp_path, pNode->thumbnail_path);
+ if (ret == THUMBNAIL_UTIL_ERROR_NONE) {
+ mf_thumb_gen_progress_cb func = pThumbGen->progress_cb;
+ if (func && pThumbGen->bIscancel == false) {
+ func(true, i, pNode);
+ } else {
+ goto EXIT;
}
- thumbnail_util_destroy(thumb_handle);
- }
- }
- if (pThumbGen->bIscancel == true) {
- goto EXIT;
- }
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->thumbnail_path2 = %s", pNode->thumbnail_path);
- break;
- }
- default:
- break;
- }
- }
- i++;
- //End........................................................
- }
- }
-
- pThumbGen->bIsStart = FALSE;
- mf_thumb_gen_complete_cb func = pThumbGen->complete_cb;
-
- if (func && pThumbGen->bIscancel == false) {
- // func(file_count, pThumbGen->pUserData);
- }
+ }
+ thumbnail_util_destroy(thumb_handle);
+ }
+ }
+ if (pThumbGen->bIscancel == true) {
+ goto EXIT;
+ }
+ MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->thumbnail_path2 = %s", pNode->thumbnail_path);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ i++;
+ //End........................................................
+ }
+ }
+
+ pThumbGen->bIsStart = FALSE;
+ mf_thumb_gen_complete_cb func = pThumbGen->complete_cb;
+
+ if (func && pThumbGen->bIscancel == false) {
+ // func(file_count, pThumbGen->pUserData);
+ }
EXIT:
- pthread_exit(0);
- thumbnail_util_destroy(thumb_handle);
- return MYFILE_ERR_NONE;
+ pthread_exit(0);
+ thumbnail_util_destroy(thumb_handle);
+ return MYFILE_ERR_NONE;
}
if (view_style != MF_VIEW_STYLE_THUMBNAIL && ap->mf_MainWindow.pNaviGenlist != NULL) {
elm_genlist_realized_items_update(ap->mf_MainWindow.pNaviGenlist);
- }
- else if (view_style == MF_VIEW_STYLE_THUMBNAIL && ap->mf_MainWindow.pNaviGengrid != NULL) {
+ } else if (view_style == MF_VIEW_STYLE_THUMBNAIL && ap->mf_MainWindow.pNaviGengrid != NULL) {
elm_gengrid_realized_items_update(ap->mf_MainWindow.pNaviGengrid);
}
//elm_genlist_realized_items_update(ap->mf_MainWindow.pNaviGenlist);
fsNodeInfo *pNode = data;
elm_genlist_item_fields_update(pNode->item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
- }else if (view_style == MF_VIEW_STYLE_THUMBNAIL && ap->mf_MainWindow.pNaviGengrid != NULL) {
+ } else if (view_style == MF_VIEW_STYLE_THUMBNAIL && ap->mf_MainWindow.pNaviGengrid != NULL) {
//elm_genlist_realized_items_update(ap->mf_MainWindow.pNaviGenlist);
fsNodeInfo *pNode = data;
elm_gengrid_item_update(pNode->item);
Ecore_Pipe *g_mf_thumbnail_progress_pipe = NULL;//Fix the bug, when clicking the image again and again quickly, there will be problem.
-typedef enum{
- THUMBNAIL_UPDATE_PROGRESS,
- THUMBNAIL_UPDATE_COMPLETE,
-}thumbnail_progress_state_e;
+typedef enum {
+ THUMBNAIL_UPDATE_PROGRESS,
+ THUMBNAIL_UPDATE_COMPLETE,
+} thumbnail_progress_state_e;
typedef struct {
int download_id;
MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>> is_at_otg is [%d]", is_at_otg);
if (is_at_otg) {//Only for otg, we will update the thumbnail
MF_THUMBNAIL_DEBUG(">>>>>>>>>>>> path is [%s]", ap->mf_Status.path->str);
- if (g_mf_thumbnail_progress_pipe == NULL)
+ if (g_mf_thumbnail_progress_pipe == NULL) {
g_mf_thumbnail_progress_pipe = ecore_pipe_add(__mf_thumbnail_progress_pipe_handler, data);
+ }
mf_thumb_gen_h thumb_gen = mf_thumb_gen_create(ap->mf_Status.path->str);
g_thumb_gen = thumb_gen;
elm_genlist_item_selected_set(item, FALSE);
}
//when longpressed, selected is called too ,so now if longpress popup exists,selected callbackwill return directly
- if (ap->mf_MainWindow.pLongpressPopup != NULL)
+ if (ap->mf_MainWindow.pLongpressPopup != NULL) {
return;
+ }
if (ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DETAIL
- || ap->mf_Status.more == MORE_EDIT_DELETE
- ) {
+ || ap->mf_Status.more == MORE_SHARE_EDIT
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DETAIL
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ ) {
MF_TRACE_END;
return;
}
mf_debug("ret is %d\n", ret);
if (ret) {
ap->mf_MainWindow.pNormalPopup =
- mf_popup_create_popup(ap, POPMODE_TEXT, NULL, MF_LABEL_UNSUPPORT_FILE_TYPE, NULL, NULL, NULL, NULL, NULL);
+ mf_popup_create_popup(ap, POPMODE_TEXT, NULL, MF_LABEL_UNSUPPORT_FILE_TYPE, NULL, NULL, NULL, NULL, NULL);
}
return ECORE_CALLBACK_CANCEL;
}
item_data->thumb_path = g_strdup(MF_ICON_SOUND);
item_data->thumbnail_type = MF_THUMBNAIL_DEFAULT;
item_data->real_thumb_flag = TRUE;
- } else if (media_data->thumbnail_path && mf_file_exists(media_data->thumbnail_path) && strcmp(media_data->thumbnail_path,MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB)) {
+ } else if (media_data->thumbnail_path && mf_file_exists(media_data->thumbnail_path) && strcmp(media_data->thumbnail_path, MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB)) {
item_data->thumb_path = g_strdup(media_data->thumbnail_path);
item_data->thumbnail_type = MF_THUMBNAIL_THUMB;
item_data->real_thumb_flag = TRUE;
mfItemData_s *item_data_tmp = NULL;
Eina_List *l = NULL;
EINA_LIST_FOREACH(category_list, l, item_data_tmp) {
- if (item_data_tmp) {
- if (g_strcmp0(itemData->m_ItemName->str, item_data_tmp->m_ItemName->str) == 0) {
- if (itemData->m_checked == true)
- item_data_tmp->m_checked = true;
- //mf_debug("itemData->m_ItemName->str1111 is [%s]", itemData->m_ItemName->str);
- //mf_debug("item_data_tmp->m_checked is [%d]", item_data_tmp->m_checked);
- break;
+ if (item_data_tmp) {
+ if (g_strcmp0(itemData->m_ItemName->str, item_data_tmp->m_ItemName->str) == 0) {
+ if (itemData->m_checked == true) {
+ item_data_tmp->m_checked = true;
}
+ //mf_debug("itemData->m_ItemName->str1111 is [%s]", itemData->m_ItemName->str);
+ //mf_debug("item_data_tmp->m_checked is [%d]", item_data_tmp->m_checked);
+ break;
}
}
+ }
if (view_type == MF_VIEW_STYLE_THUMBNAIL) {
it = elm_gengrid_item_next_get(it);
} else {
}
}
-void mf_category_list_update_cb (media_content_error_e error, int pid,
- media_content_db_update_item_type_e update_item,
- media_content_db_update_type_e update_type, media_content_type_e media_type,
- char *uuid, char *path, char *mime_type, void *user_data)
+void mf_category_list_update_cb(media_content_error_e error, int pid,
+ media_content_db_update_item_type_e update_item,
+ media_content_db_update_type_e update_type, media_content_type_e media_type,
+ char *uuid, char *path, char *mime_type, void *user_data)
{
- int pre_more = MORE_DEFAULT;
- Evas_Object *newContent = NULL;
- struct appdata *ap = (struct appdata *)mf_get_appdata();
-
- mf_debug("update_item : [%d] update_type : [%d] media_type : [%d]",
- update_item, update_type, media_type);
-
- if (ap->mf_Status.view_type == mf_view_recent) {
- if(mf_view_is_item_exists_by_name(ap, path)) {
- mf_recent_view_create(ap);
- return;
- }
- }
- if (ap->mf_Status.more == MORE_SEARCH || mf_view_get_pre_state(ap) == MORE_SEARCH)
- {
- mf_category_search_item_update(user_data, path, update_item, update_type, uuid);
- return;
- }
-
- switch (update_type)
- {
- case MEDIA_CONTENT_INSERT://go through.
- {
- mf_debug("MEDIA_CONTENT_INSERT");
- /* TODO : need to add lists, not to update whole lists */
- //break;//go through.
- }
- case MEDIA_CONTENT_UPDATE:
- {
- mf_debug("MEDIA_CONTENT_UPDATE");
-
- if ((ap->mf_Status.more == MORE_SEARCH || mf_view_get_pre_state(ap) == MORE_SEARCH) &&
- (ap->mf_Status.search_filter!=NULL))
- {
- if (!ap->mf_Status.b_run_background) {
- mf_category_view_refresh_space_size_set(true);
- mf_category_size_update(ap);
- return;
- }
-
- if (mf_is_dir(path)) {
- mf_category_view_refresh_space_size_set(true);
- mf_category_size_update(ap);
- return;
- }
-
- if (mf_util_NFD_strstr(mf_file_get(path), ap->mf_Status.search_filter))
- {
- media_info_h handle = NULL;
- int ret = media_info_get_media_from_db(uuid, &handle);
-
- if (ret == MEDIA_CONTENT_ERROR_NONE)
- {
- media_data_s *media_data = mf_media_data_get_by_media_handle(handle);
- if (media_data) {
- mf_view_item_popup_check(ap, path);
- if (!mf_util_NFD_strstr(media_data->display_name, ap->mf_Status.search_filter)) {
- mf_view_item_delete_by_name(ap, path);
- } else {
- mf_view_search_item_update(ap, path, media_data->fullpath);
- }
- mf_media_data_item_free(&media_data);
- }
- }
-
- if (handle) {
- media_info_destroy(handle);
- handle = NULL;
- }
- }
- }
- else
- {
- if (ap->mf_Status.view_type == mf_view_root_category &&
- mf_view_get_pre_state(ap) != MORE_SEARCH &&
- (ap->mf_Status.more == MORE_DEFAULT || ap->mf_Status.more == MORE_EDIT ||
- ap->mf_Status.more == MORE_SHARE_EDIT || ap->mf_Status.more == MORE_EDIT_COPY ||
- ap->mf_Status.more == MORE_EDIT_MOVE || ap->mf_Status.more == MORE_EDIT_DELETE ||
- ap->mf_Status.more == MORE_EDIT_DETAIL))
- { /* if it is rename state, don't refresh list */
- if (mf_callback_monitor_media_db_update_flag_get()) {
- mf_callback_monitor_media_db_update_flag_set(EINA_FALSE);
- mf_category_view_refresh_space_size_set(true);
- return;
- }
-
- Eina_List *file_list = NULL;
- int pre_more = ap->mf_Status.more;
-
- if (ap->mf_Status.more == MORE_THUMBNAIL_RENAME) {
- mf_view_state_reset_state_with_pre(ap);
- }
-
- if (ap->mf_MainWindow.pNewFolderPopup) {
- SAFE_FREE_OBJ(ap->mf_MainWindow.pNewFolderPopup);
- }
-
- if (pre_more == MORE_EDIT ||
- pre_more == MORE_SHARE_EDIT ||
- pre_more == MORE_EDIT_COPY ||
- pre_more == MORE_EDIT_MOVE ||
- pre_more == MORE_EDIT_DELETE ||
- pre_more == MORE_EDIT_DETAIL)
- {
- ap->mf_Status.more = MORE_DEFAULT;
- file_list = mf_edit_get_selected_file_list();
- }
-
- elm_box_clear(ap->mf_MainWindow.pNaviBox);
- newContent = mf_category_get_from_media_db(ap, ap->mf_Status.category_type, true);
- elm_box_pack_end(ap->mf_MainWindow.pNaviBox, newContent);
- evas_object_show(newContent);
- //mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, newContent);
-
- if (pre_more == MORE_EDIT ||
- pre_more == MORE_EDIT_COPY ||
- pre_more == MORE_EDIT_MOVE ||
- pre_more == MORE_EDIT_DELETE ||
- pre_more == MORE_EDIT_DETAIL)
- {
- if (!ap->mf_Status.flagNoContent) {
- ap->mf_Status.more = pre_more;
- mf_edit_view_refresh(ap, &file_list, NULL);
- } else {
- mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
- mf_navi_bar_title_content_set(ap, ap->mf_Status.categorytitle);
- }
- } else if (pre_more == MORE_SHARE_EDIT) {
- if (!ap->mf_Status.flagNoContent) {
- ap->mf_Status.more = pre_more;
- mf_edit_view_refresh(ap, &file_list, NULL);
- } else {
- mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
- mf_navi_bar_title_content_set(ap, ap->mf_Status.categorytitle);
- }
- }
- }
- }
-
- mf_category_view_refresh_space_size_set(true);
- mf_category_size_update(ap);
- //mf_storage_refresh(ap);
- }
- break;
-
- case MEDIA_CONTENT_DELETE:
- {
- if (ap->mf_MainWindow.pDeleteConfirmPopup) {
- SAFE_FREE_OBJ(ap->mf_MainWindow.pDeleteConfirmPopup);
- ap->mf_FileOperation.idle_delete_item = NULL;
- }
- mf_category_list_item_remove(path, media_type);
- mf_category_view_refresh_space_size_set(true);
- if (ap->mf_Status.more == MORE_IDLE_DELETE) {
- return;
- }
- if (ap->mf_Status.view_type == mf_view_root_category && mf_view_get_pre_state(ap) != MORE_SEARCH
- && (ap->mf_Status.more == MORE_DEFAULT ||
- ap->mf_Status.more == MORE_EDIT ||
- ap->mf_Status.more == MORE_SHARE_EDIT ||
- ap->mf_Status.more == MORE_THUMBNAIL_RENAME ||
- ap->mf_Status.more == MORE_EDIT_COPY ||
- ap->mf_Status.more == MORE_EDIT_MOVE ||
- ap->mf_Status.more == MORE_EDIT_DETAIL ||
- ap->mf_Status.more == MORE_EDIT_DELETE))
- {
- Eina_List *file_list = NULL;
- if (mf_callback_monitor_media_db_update_flag_get()) {
- return;
- }
-
- if (ap->mf_Status.more == MORE_EDIT ||
- ap->mf_Status.more == MORE_SHARE_EDIT ||
- ap->mf_Status.more == MORE_EDIT_COPY ||
- ap->mf_Status.more == MORE_EDIT_MOVE ||
- ap->mf_Status.more == MORE_EDIT_DELETE ||
- ap->mf_Status.more == MORE_EDIT_DETAIL
- )
- {
- pre_more = ap->mf_Status.more;
- ap->mf_Status.more = MORE_DEFAULT;
- file_list = mf_edit_get_selected_file_list();
- }
-
- mf_object_box_clear(ap->mf_MainWindow.pNaviBox);
- newContent = mf_category_get_from_media_db(ap, ap->mf_Status.category_type, true);
- elm_box_pack_end(ap->mf_MainWindow.pNaviBox, newContent);
- //mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, newContent);
-
- if (pre_more == MORE_EDIT || pre_more == MORE_SHARE_EDIT
- || pre_more == MORE_EDIT_COPY
- || pre_more == MORE_EDIT_MOVE
- || pre_more == MORE_EDIT_DELETE
- || pre_more == MORE_EDIT_DETAIL
- ) {
- if (!ap->mf_Status.flagNoContent) {
- ap->mf_Status.more = pre_more;
- mf_edit_view_refresh(ap, &file_list, NULL);
- } else {
- mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
- mf_navi_bar_title_content_set(ap, ap->mf_Status.categorytitle);
- }
- }
- }
- //mf_storage_refresh(ap);
- }
- break;
-
- default:
- mf_debug("Invalid Case : %d", update_type);
- break;
- }
+ int pre_more = MORE_DEFAULT;
+ Evas_Object *newContent = NULL;
+ struct appdata *ap = (struct appdata *)mf_get_appdata();
+
+ mf_debug("update_item : [%d] update_type : [%d] media_type : [%d]",
+ update_item, update_type, media_type);
+
+ if (ap->mf_Status.view_type == mf_view_recent) {
+ if (mf_view_is_item_exists_by_name(ap, path)) {
+ mf_recent_view_create(ap);
+ return;
+ }
+ }
+ if (ap->mf_Status.more == MORE_SEARCH || mf_view_get_pre_state(ap) == MORE_SEARCH) {
+ mf_category_search_item_update(user_data, path, update_item, update_type, uuid);
+ return;
+ }
+
+ switch (update_type) {
+ case MEDIA_CONTENT_INSERT: { //go through.
+ mf_debug("MEDIA_CONTENT_INSERT");
+ /* TODO : need to add lists, not to update whole lists */
+ //break;//go through.
+ }
+ case MEDIA_CONTENT_UPDATE: {
+ mf_debug("MEDIA_CONTENT_UPDATE");
+
+ if ((ap->mf_Status.more == MORE_SEARCH || mf_view_get_pre_state(ap) == MORE_SEARCH) &&
+ (ap->mf_Status.search_filter != NULL)) {
+ if (!ap->mf_Status.b_run_background) {
+ mf_category_view_refresh_space_size_set(true);
+ mf_category_size_update(ap);
+ return;
+ }
+
+ if (mf_is_dir(path)) {
+ mf_category_view_refresh_space_size_set(true);
+ mf_category_size_update(ap);
+ return;
+ }
+
+ if (mf_util_NFD_strstr(mf_file_get(path), ap->mf_Status.search_filter)) {
+ media_info_h handle = NULL;
+ int ret = media_info_get_media_from_db(uuid, &handle);
+
+ if (ret == MEDIA_CONTENT_ERROR_NONE) {
+ media_data_s *media_data = mf_media_data_get_by_media_handle(handle);
+ if (media_data) {
+ mf_view_item_popup_check(ap, path);
+ if (!mf_util_NFD_strstr(media_data->display_name, ap->mf_Status.search_filter)) {
+ mf_view_item_delete_by_name(ap, path);
+ } else {
+ mf_view_search_item_update(ap, path, media_data->fullpath);
+ }
+ mf_media_data_item_free(&media_data);
+ }
+ }
+
+ if (handle) {
+ media_info_destroy(handle);
+ handle = NULL;
+ }
+ }
+ } else {
+ if (ap->mf_Status.view_type == mf_view_root_category &&
+ mf_view_get_pre_state(ap) != MORE_SEARCH &&
+ (ap->mf_Status.more == MORE_DEFAULT || ap->mf_Status.more == MORE_EDIT ||
+ ap->mf_Status.more == MORE_SHARE_EDIT || ap->mf_Status.more == MORE_EDIT_COPY ||
+ ap->mf_Status.more == MORE_EDIT_MOVE || ap->mf_Status.more == MORE_EDIT_DELETE ||
+ ap->mf_Status.more == MORE_EDIT_DETAIL)) {
+ /* if it is rename state, don't refresh list */
+ if (mf_callback_monitor_media_db_update_flag_get()) {
+ mf_callback_monitor_media_db_update_flag_set(EINA_FALSE);
+ mf_category_view_refresh_space_size_set(true);
+ return;
+ }
+
+ Eina_List *file_list = NULL;
+ int pre_more = ap->mf_Status.more;
+
+ if (ap->mf_Status.more == MORE_THUMBNAIL_RENAME) {
+ mf_view_state_reset_state_with_pre(ap);
+ }
+
+ if (ap->mf_MainWindow.pNewFolderPopup) {
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNewFolderPopup);
+ }
+
+ if (pre_more == MORE_EDIT ||
+ pre_more == MORE_SHARE_EDIT ||
+ pre_more == MORE_EDIT_COPY ||
+ pre_more == MORE_EDIT_MOVE ||
+ pre_more == MORE_EDIT_DELETE ||
+ pre_more == MORE_EDIT_DETAIL) {
+ ap->mf_Status.more = MORE_DEFAULT;
+ file_list = mf_edit_get_selected_file_list();
+ }
+
+ elm_box_clear(ap->mf_MainWindow.pNaviBox);
+ newContent = mf_category_get_from_media_db(ap, ap->mf_Status.category_type, true);
+ elm_box_pack_end(ap->mf_MainWindow.pNaviBox, newContent);
+ evas_object_show(newContent);
+ //mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, newContent);
+
+ if (pre_more == MORE_EDIT ||
+ pre_more == MORE_EDIT_COPY ||
+ pre_more == MORE_EDIT_MOVE ||
+ pre_more == MORE_EDIT_DELETE ||
+ pre_more == MORE_EDIT_DETAIL) {
+ if (!ap->mf_Status.flagNoContent) {
+ ap->mf_Status.more = pre_more;
+ mf_edit_view_refresh(ap, &file_list, NULL);
+ } else {
+ mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
+ mf_navi_bar_title_content_set(ap, ap->mf_Status.categorytitle);
+ }
+ } else if (pre_more == MORE_SHARE_EDIT) {
+ if (!ap->mf_Status.flagNoContent) {
+ ap->mf_Status.more = pre_more;
+ mf_edit_view_refresh(ap, &file_list, NULL);
+ } else {
+ mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
+ mf_navi_bar_title_content_set(ap, ap->mf_Status.categorytitle);
+ }
+ }
+ }
+ }
+
+ mf_category_view_refresh_space_size_set(true);
+ mf_category_size_update(ap);
+ //mf_storage_refresh(ap);
+ }
+ break;
+
+ case MEDIA_CONTENT_DELETE: {
+ if (ap->mf_MainWindow.pDeleteConfirmPopup) {
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pDeleteConfirmPopup);
+ ap->mf_FileOperation.idle_delete_item = NULL;
+ }
+ mf_category_list_item_remove(path, media_type);
+ mf_category_view_refresh_space_size_set(true);
+ if (ap->mf_Status.more == MORE_IDLE_DELETE) {
+ return;
+ }
+ if (ap->mf_Status.view_type == mf_view_root_category && mf_view_get_pre_state(ap) != MORE_SEARCH
+ && (ap->mf_Status.more == MORE_DEFAULT ||
+ ap->mf_Status.more == MORE_EDIT ||
+ ap->mf_Status.more == MORE_SHARE_EDIT ||
+ ap->mf_Status.more == MORE_THUMBNAIL_RENAME ||
+ ap->mf_Status.more == MORE_EDIT_COPY ||
+ ap->mf_Status.more == MORE_EDIT_MOVE ||
+ ap->mf_Status.more == MORE_EDIT_DETAIL ||
+ ap->mf_Status.more == MORE_EDIT_DELETE)) {
+ Eina_List *file_list = NULL;
+ if (mf_callback_monitor_media_db_update_flag_get()) {
+ return;
+ }
+
+ if (ap->mf_Status.more == MORE_EDIT ||
+ ap->mf_Status.more == MORE_SHARE_EDIT ||
+ ap->mf_Status.more == MORE_EDIT_COPY ||
+ ap->mf_Status.more == MORE_EDIT_MOVE ||
+ ap->mf_Status.more == MORE_EDIT_DELETE ||
+ ap->mf_Status.more == MORE_EDIT_DETAIL
+ ) {
+ pre_more = ap->mf_Status.more;
+ ap->mf_Status.more = MORE_DEFAULT;
+ file_list = mf_edit_get_selected_file_list();
+ }
+
+ mf_object_box_clear(ap->mf_MainWindow.pNaviBox);
+ newContent = mf_category_get_from_media_db(ap, ap->mf_Status.category_type, true);
+ elm_box_pack_end(ap->mf_MainWindow.pNaviBox, newContent);
+ //mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, newContent);
+
+ if (pre_more == MORE_EDIT || pre_more == MORE_SHARE_EDIT
+ || pre_more == MORE_EDIT_COPY
+ || pre_more == MORE_EDIT_MOVE
+ || pre_more == MORE_EDIT_DELETE
+ || pre_more == MORE_EDIT_DETAIL
+ ) {
+ if (!ap->mf_Status.flagNoContent) {
+ ap->mf_Status.more = pre_more;
+ mf_edit_view_refresh(ap, &file_list, NULL);
+ } else {
+ mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
+ mf_navi_bar_title_content_set(ap, ap->mf_Status.categorytitle);
+ }
+ }
+ }
+ //mf_storage_refresh(ap);
+ }
+ break;
+
+ default:
+ mf_debug("Invalid Case : %d", update_type);
+ break;
+ }
}
void mf_category_list_destory()
ap->mf_MainWindow.pNaviGengrid = mf_gengrid_create_grid(ap->mf_MainWindow.pNaviBar);
mf_category_gen_style_set();
parent = ap->mf_MainWindow.pNaviGengrid;
- evas_object_smart_callback_add(ap->mf_MainWindow.pNaviGengrid, "language,changed", mf_gengrid_gl_lang_changed, ap);
- //evas_object_smart_callback_add(ap->mf_MainWindow.pNaviGengrid, "longpressed", mf_gengrid_thumbs_longpressed, ap);
+ evas_object_smart_callback_add(ap->mf_MainWindow.pNaviGengrid, "language,changed", mf_gengrid_gl_lang_changed, ap);
+ //evas_object_smart_callback_add(ap->mf_MainWindow.pNaviGengrid, "longpressed", mf_gengrid_thumbs_longpressed, ap);
evas_object_smart_callback_add(ap->mf_MainWindow.pNaviGengrid, "selected", __mf_category_item_sel, ap);
evas_object_smart_callback_add(ap->mf_MainWindow.pNaviGengrid, "realized", mf_gengrid_realized, ap);
Eina_List *category_list = NULL;
EINA_LIST_FOREACH(file_list, l, media_data) {
- if (media_data) {
- mfItemData_s *item_data = NULL;
- item_data = mf_category_media_data_generate(media_data);
- if (item_data) {
- mf_debug("============= name is [%s]", item_data->m_ItemName->str);
- category_list = eina_list_append(category_list, item_data);
- }
- }
+ if (media_data) {
+ mfItemData_s *item_data = NULL;
+ item_data = mf_category_media_data_generate(media_data);
+ if (item_data) {
+ mf_debug("============= name is [%s]", item_data->m_ItemName->str);
+ category_list = eina_list_append(category_list, item_data);
+ }
+ }
}
return category_list;
}
mf_retvm_if(ap == NULL, NULL, "input data error");
Eina_List *media_list = NULL;
Eina_List *category_list = NULL;
-
+
mf_media_data_list_free(&mf_category_file_list);
mf_media_category_list_get(category, &media_list);
-
+
int sort_type = 0;
mf_util_get_pref_value(PREF_TYPE_SORT_TYPE, &sort_type);
mf_media_data_sort_list(&media_list, sort_type);
mf_category_file_list = media_list;
- category_list = mf_category_list_generate(media_list);
+ category_list = mf_category_list_generate(media_list);
if (is_use_previous_state) {
mf_view_refresh_edit_status_for_category_list(category_list);
struct appdata *ap = (struct appdata *)data;
Evas_Object *newContent = mf_category_get_from_media_db(ap, ap->mf_Status.category_type, false);
elm_box_pack_end(ap->mf_MainWindow.pNaviBox, newContent);
- //mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, newContent);
- SAFE_FREE_OBJ(mf_category_view_popup);
- mf_category_view_idler = NULL;
+ //mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, newContent);
+ SAFE_FREE_OBJ(mf_category_view_popup);
+ mf_category_view_idler = NULL;
return ECORE_CALLBACK_CANCEL;
}
t_start;
struct appdata *ap = (struct appdata *)data;
- mf_retm_if (ap->mf_MainWindow.pNaviBar == NULL, "ap->mf_MainWindow.pNaviBar is NULL");
+ mf_retm_if(ap->mf_MainWindow.pNaviBar == NULL, "ap->mf_MainWindow.pNaviBar is NULL");
Evas_Object *newContent = NULL;
//Evas_Object *pathinfo = NULL;
ap->mf_Status.view_type = mf_view_root_category;
return;
}
- mf_retm_if (ap->mf_MainWindow.pNaviBar == NULL, "ap->mf_MainWindow.pNaviBar is NULL");
+ mf_retm_if(ap->mf_MainWindow.pNaviBar == NULL, "ap->mf_MainWindow.pNaviBar is NULL");
Evas_Object *newContent = NULL;
ap->mf_Status.view_type = mf_view_root_category;
//int view_style = mf_view_style_get(ap);
}
//Evas_Object *pathinfo = mf_genlist_create_path_info(ap->mf_MainWindow.pNaviLayout, ap->mf_Status.categorytitle, EINA_FALSE);
-
+
//elm_object_part_content_set(ap->mf_MainWindow.pNaviLayout, "pathinfo", pathinfo);
//elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_FALSE, EINA_FALSE);
mf_navi_bar_title_content_set(ap, LABEL_MYFILE_CHAP);
#define MF_CTXPOPUP_STYLE_MORE "more/default"
enum __context_popup_type {
- CONTEXT_POPUP_TYPE_NONE,
- CONTEXT_POPUP_TYPE_MORE,
- CONTEXT_POPUP_TYPE_SEARCH_FILTER,
- CONTEXT_POPUP_TYPE_MAX
+ CONTEXT_POPUP_TYPE_NONE,
+ CONTEXT_POPUP_TYPE_MORE,
+ CONTEXT_POPUP_TYPE_SEARCH_FILTER,
+ CONTEXT_POPUP_TYPE_MAX
};
static void _move_ctxpopup_all(void *data, Evas_Object *parent, Evas_Object *ctxpopup)
int changed_angle = elm_win_rotation_get(ap->mf_MainWindow.pWindow);
mf_error("changed_angle is [%d]", changed_angle);
switch (changed_angle) {
- case APP_DEVICE_ORIENTATION_270:
- case APP_DEVICE_ORIENTATION_90:
- {//landscape
- x= x + (w /2)+7;
- y= y + (h /2);
- mf_error("x is [%d] y is [%d]", x, y);
- break;
- }
- case APP_DEVICE_ORIENTATION_180:
- case APP_DEVICE_ORIENTATION_0 :
- {//portrait
-
- x= x + (w /2);
- //y= y + h - 4;
- y = y+h+12;
- mf_error("x is [%d] y is [%d]", x, y);
- break;
- }
- default:
- break;
+ case APP_DEVICE_ORIENTATION_270:
+ case APP_DEVICE_ORIENTATION_90: {
+ //landscape
+ x = x + (w / 2) + 7;
+ y = y + (h / 2);
+ mf_error("x is [%d] y is [%d]", x, y);
+ break;
+ }
+ case APP_DEVICE_ORIENTATION_180:
+ case APP_DEVICE_ORIENTATION_0 : {
+ //portrait
+
+ x = x + (w / 2);
+ //y= y + h - 4;
+ y = y + h + 12;
+ mf_error("x is [%d] y is [%d]", x, y);
+ break;
+ }
+ default:
+ break;
}
evas_object_move(ctxpopup, x , y);
elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_DOWN,
- ELM_CTXPOPUP_DIRECTION_LEFT,
- ELM_CTXPOPUP_DIRECTION_RIGHT,
- ELM_CTXPOPUP_DIRECTION_UP);
+ ELM_CTXPOPUP_DIRECTION_LEFT,
+ ELM_CTXPOPUP_DIRECTION_RIGHT,
+ ELM_CTXPOPUP_DIRECTION_UP);
//end*/
} else {
evas_object_move(ctxpopup, touch_x, touch_y);
elm_win_screen_size_get(win, NULL, NULL, &w, &h);
pos = elm_win_rotation_get(win);
switch (pos) {
- case 0:
- case 180:
- x = w / 2;
- y = h;
+ case 0:
+ case 180:
+ x = w / 2;
+ y = h;
break;
- case 90:
- x = h / 2;
- y = w;
- break;
- case 270:
- x = h / 2;
- y = w;
+ case 90:
+ x = h / 2;
+ y = w;
+ break;
+ case 270:
+ x = h / 2;
+ y = w;
break;
}
//elm_win_screen_size_get(win, NULL, NULL, &w, &h);
if (g_strcmp0(button_label, label) == 0) {
Evas_Object *icon = elm_toolbar_item_object_get(pItem);
evas_object_geometry_get(icon, &x_position, &y_position, &w, NULL);
- *x = x_position+w/2;
+ *x = x_position + w / 2;
*y = y_position;
return;
}
case mf_context_popup_item_view_by:
item = elm_ctxpopup_item_append(ctxpopup, LABEL_VIEW_AS, image, mf_callback_view_as_cb, data);
mf_object_item_translate_set(item, LABEL_VIEW_AS);
- break;
+ break;
case mf_context_popup_item_sort_by:
item = elm_ctxpopup_item_append(ctxpopup, LABEL_SORT_BY, image, mf_callback_list_by_view_cb, data);
mf_object_item_translate_set(item, LABEL_SORT_BY);
//Added by jian12.li, for fixing the context popup is rotated problem, when rotate context popup, press the back key, it will be show again.
static void __mf_ctxpopup_parent_resize_cb(void *data, Evas *e,
- Evas_Object *obj, void *ei)
+ Evas_Object *obj, void *ei)
{
MF_TRACE_BEGIN;
mf_retm_if(!data, "data is NULL");
evas_object_data_set((Evas_Object *)data, MF_CTXPOPUP_OBJ_ROTATE_KEY,
- (void*)true);
+ (void*)true);
}
static void __mf_ctxpopup_search_filter_rotate_cb(void *data, Evas_Object *obj, void *ei)
struct appdata *ap = (struct appdata *)data;
bool ct_rotate = (bool)evas_object_data_get(obj,
- MF_CTXPOPUP_OBJ_ROTATE_KEY);
+ MF_CTXPOPUP_OBJ_ROTATE_KEY);
if (!ct_rotate) {
mf_debug("ctxpopup is dismissed");
evas_object_del(obj);
/* when "dismissed" cb is called next time,
* ctxpopup should be dismissed if device is not rotated. */
evas_object_data_set(obj, MF_CTXPOPUP_OBJ_ROTATE_KEY,
- (void*)false);
+ (void*)false);
/* If ctxpopup is not dismissed, then it must be shown again.
* Otherwise "dismissed" cb will be called one more time. */
if (searchfilter_ctxpopup) {
struct appdata *ap = (struct appdata *)data;
bool ct_rotate = (bool)evas_object_data_get(obj,
- MF_CTXPOPUP_OBJ_ROTATE_KEY);
+ MF_CTXPOPUP_OBJ_ROTATE_KEY);
if (!ct_rotate) {
mf_debug("ctxpopup is dismissed");
/* when "dismissed" cb is called next time,
* ctxpopup should be dismissed if device is not rotated. */
evas_object_data_set(obj, MF_CTXPOPUP_OBJ_ROTATE_KEY,
- (void*)false);
+ (void*)false);
/* If ctxpopup is not dismissed, then it must be shown again.
* Otherwise "dismissed" cb will be called one more time. */
if (ap->mf_MainWindow.pContextPopup) {
evas_object_data_del(ctxpopup, MF_CTXPOPUP_OBJ_MORE_BTN_KEY);
evas_object_data_del(ctxpopup, MF_CTXPOPUP_OBJ_ROTATE_KEY);
evas_object_smart_callback_del(ctxpopup, "dismissed",
- __mf_ctxpopup_hide_cb);
+ __mf_ctxpopup_hide_cb);
evas_object_event_callback_del(ap->mf_MainWindow.pWindow,
- EVAS_CALLBACK_RESIZE,
- __mf_ctxpopup_parent_resize_cb);
+ EVAS_CALLBACK_RESIZE,
+ __mf_ctxpopup_parent_resize_cb);
evas_object_smart_callback_del(elm_object_top_widget_get(ctxpopup),
- "rotation,changed",
- __mf_ctxpopup_rotate_cb);
+ "rotation,changed",
+ __mf_ctxpopup_rotate_cb);
evas_object_event_callback_del(ctxpopup, EVAS_CALLBACK_DEL,
- __mf_ctxpopup_del_cb);
+ __mf_ctxpopup_del_cb);
/*evas_object_smart_callback_del(ap->maininfo.naviframe,
"ctxpopup,items,update",
__mf_ctxpopup_items_update_cb);*/
//evas_object_event_callback_del(ap->mf_MainWindow.pWindow, EVAS_CALLBACK_RESIZE, mf_ug_resize_more_ctxpopup_cb);
//evas_object_event_callback_add(ap->mf_MainWindow.pWindow, EVAS_CALLBACK_RESIZE, (Evas_Object_Event_Cb)mf_ug_resize_more_ctxpopup_cb, ap);
evas_object_smart_callback_add(ctxpopup, "dismissed",
- __mf_ctxpopup_hide_cb, data);
+ __mf_ctxpopup_hide_cb, data);
evas_object_smart_callback_add(elm_object_top_widget_get(ctxpopup),
- "rotation,changed",
- __mf_ctxpopup_rotate_cb, data);
+ "rotation,changed",
+ __mf_ctxpopup_rotate_cb, data);
evas_object_event_callback_add(ap->mf_MainWindow.pWindow,
- EVAS_CALLBACK_RESIZE,
- __mf_ctxpopup_parent_resize_cb,
- ctxpopup);
+ EVAS_CALLBACK_RESIZE,
+ __mf_ctxpopup_parent_resize_cb,
+ ctxpopup);
evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL,
- __mf_ctxpopup_del_cb, data);
+ __mf_ctxpopup_del_cb, data);
/*evas_object_smart_callback_add(ap->mf_MainWindow.pWindow,
"ctxpopup,items,update",
__mf_ctxpopup_items_update_cb, ctxpopup);*/
elm_object_style_set(ctxpopup, "more/default");
elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP,
- ELM_CTXPOPUP_DIRECTION_UNKNOWN,
- ELM_CTXPOPUP_DIRECTION_UNKNOWN,
- ELM_CTXPOPUP_DIRECTION_UNKNOWN);
+ ELM_CTXPOPUP_DIRECTION_UNKNOWN,
+ ELM_CTXPOPUP_DIRECTION_UNKNOWN,
+ ELM_CTXPOPUP_DIRECTION_UNKNOWN);
ap->mf_MainWindow.pContextPopup = ctxpopup;
if (ap->mf_Status.more == MORE_DEFAULT) {
//1 Setting
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_setting);
} else if (ap->mf_Status.view_type == mf_view_root_category) {
- //1 Search
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_search);
+ //1 Search
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_search);
if (ap->mf_Status.flagNoContent == EINA_FALSE) {
- //1 Share
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_share);
-
- //1 Delete
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_delete);
- //1 Move
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_move);
- //1 Copy
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_copy);
- //1 Rename
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_rename);
- //1 Edit
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_edit);
+ //1 Share
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_share);
+
+ //1 Delete
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_delete);
+ //1 Move
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_move);
+ //1 Copy
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_copy);
+ //1 Rename
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_rename);
+ //1 Edit
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_edit);
}
//1 View by
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_view_by);
ap->mf_Status.flagNoContent = EINA_TRUE;
}
//1 Search
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_search);
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_search);
if (ap->mf_Status.flagNoContent == EINA_FALSE) {
//1 Share
//1 Share
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_share);
}
- //1 Delete
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_delete);
- //1 Move
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_move);
- //1 Copy
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_copy);
+ //1 Delete
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_delete);
+ //1 Move
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_move);
+ //1 Copy
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_copy);
}
if (ap->mf_Status.flagNoContent == EINA_FALSE) {
//1 Create
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_new_folder);
- //1 Rename
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_rename);
- //1 Edit
- //__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_edit);
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_new_folder);
+ //1 Rename
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_rename);
+ //1 Edit
+ //__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_edit);
//1 View by
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_view_by);
//1 Details
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_details);
- }else{
+ } else {
//1 View by
- __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_view_by);
+ __mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_view_by);
//1 Sort by
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_sort_by);
}
//__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_setting);
}
- } else if (ap->mf_Status.more == MORE_SEARCH){
+ } else if (ap->mf_Status.more == MORE_SEARCH) {
if (ap->mf_Status.flagNoContent == EINA_FALSE) {
//delete
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_delete);
//1 Share
if (!(ap->mf_FileOperation.search_result_file_list == NULL ||
- eina_list_count(ap->mf_FileOperation.search_result_file_list) == 0)) {
+ eina_list_count(ap->mf_FileOperation.search_result_file_list) == 0)) {
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_share);
}
//1 Move
}
} else if (ap->mf_Status.more == MORE_EDIT) {
- return;
+ return;
//1 Copy
//__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_copy); //fix P130916-02998 by ray
//__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_move); // fix P130916-02998 by ray
} else if (ap->mf_Status.more == MORE_INTERNAL_MOVE ||
- ap->mf_Status.more == MORE_INTERNAL_COPY ||
- ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS) {
+ ap->mf_Status.more == MORE_INTERNAL_COPY ||
+ ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS) {
//1 Create
__mf_context_popup_item_append(ctxpopup, ap, mf_context_popup_item_new_folder);
}
- if (ctxpopup)
- {
+ if (ctxpopup) {
__mf_ctxpopup_add_callbacks(ap, ctxpopup);
}
_move_more_ctxpopup(ap, ap->mf_MainWindow.pWindow, ctxpopup);
evas_object_show(ctxpopup);
evas_object_smart_callback_add(ctxpopup, "dismissed",
- __mf_ctxpopup_search_filter_hide_cb, user_data);
+ __mf_ctxpopup_search_filter_hide_cb, user_data);
evas_object_smart_callback_add(elm_object_top_widget_get(ctxpopup),
- "rotation,changed",
- __mf_ctxpopup_search_filter_rotate_cb, ap);
+ "rotation,changed",
+ __mf_ctxpopup_search_filter_rotate_cb, ap);
evas_object_event_callback_add(ap->mf_MainWindow.pWindow,
- EVAS_CALLBACK_RESIZE,
- __mf_ctxpopup_parent_resize_cb,
- ctxpopup);
+ EVAS_CALLBACK_RESIZE,
+ __mf_ctxpopup_parent_resize_cb,
+ ctxpopup);
return ctxpopup;
}
mf_detail_data_destroy(ap);
- mf_retm_if(ap->mf_MainWindow.pNaviBar == NULL,"ap->mf_MainWindow.pNaviBar is NULL");
+ mf_retm_if(ap->mf_MainWindow.pNaviBar == NULL, "ap->mf_MainWindow.pNaviBar is NULL");
if (ap->mf_Status.more == MORE_DEFAULT) {
ap->mf_Status.view_type = ap->mf_Status.preViewType;
mf_view_update(ap);
ap->mf_MainWindow.pNaviGenlist = NULL;
} else {
Evas_Object *genlist = mf_ug_detail_view_create_genlist(ap->mf_MainWindow.pNaviLayout,
- ap->mf_Status.detail);
+ ap->mf_Status.detail);
mf_ug_detail_view_process_genlist(ap->mf_Status.detail, genlist);
evas_object_show(genlist);
MF_TA_ACUM_ITEM_BEGIN("123456 push naviframe item", 0);
if (ap->mf_Status.pPreNaviItem) {
ap->mf_MainWindow.pNaviItem = elm_naviframe_item_insert_after(ap->mf_MainWindow.pNaviBar,
- ap->mf_Status.pPreNaviItem,
- "", NULL, NULL,
- ap->mf_MainWindow.pNaviLayout,
- MF_NAVI_STYLE_ENABLE);
+ ap->mf_Status.pPreNaviItem,
+ "", NULL, NULL,
+ ap->mf_MainWindow.pNaviLayout,
+ MF_NAVI_STYLE_ENABLE);
} else {
ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(ap->mf_MainWindow.pNaviBar,
- NULL, NULL, NULL,
- ap->mf_MainWindow.pNaviLayout,
- MF_NAVI_STYLE_ENABLE);
+ NULL, NULL, NULL,
+ ap->mf_MainWindow.pNaviLayout,
+ MF_NAVI_STYLE_ENABLE);
}
// Evas_Object *pImage = elm_image_add(ap->mf_MainWindow.pNaviBar);
void mf_edit_folder_list_append(void *data)
{
if (edit_folder_list) {
- if (eina_list_data_find(edit_folder_list, data) == NULL)
+ if (eina_list_data_find(edit_folder_list, data) == NULL) {
edit_folder_list = eina_list_append(edit_folder_list, data);
+ }
} else {
edit_folder_list = eina_list_append(edit_folder_list, data);
}
void mf_edit_file_list_append(void *data)
{
if (edit_file_list) {
- if (eina_list_data_find(edit_file_list, data) == NULL)
+ if (eina_list_data_find(edit_file_list, data) == NULL) {
edit_file_list = eina_list_append(edit_file_list, data);
+ }
} else {
edit_file_list = eina_list_append(edit_file_list, data);
}
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
-
+
Evas_Object *genlist = NULL;
Elm_Object_Item *it = NULL;
mf_list_data_t *item_data = NULL;
mf_edit_select_all_set(EINA_FALSE);
mf_edit_count_set(0);
-
+
edit_count = elm_genlist_items_count(genlist);
selected_all = EINA_FALSE;
it = elm_genlist_first_item_get(genlist);
label = g_strdup(MF_LABEL_SELECT_ITEMS);
}
mf_object_item_text_set(ap->mf_MainWindow.pNaviItem, label, "elm.text.title");
- SAFE_FREE_CHAR(label);
+ SAFE_FREE_CHAR(label);
}
Eina_Bool state = elm_check_state_get(pSelectAllCheckBox);
if (state) {
elm_object_signal_emit(pSelectAllCheckBox, "elm,activate,check,off", "elm");
- }
- else {
+ } else {
elm_object_signal_emit(pSelectAllCheckBox, "elm,activate,check,on", "elm");
}
}
elm_check_state_set(it_data->pCheckBox, it_data->m_checked);
}
- // elm_genlist_item_update(it);
+ // elm_genlist_item_update(it);
it = elm_genlist_item_next_get(it);
}
//elm_genlist_realized_items_update(ap->mf_MainWindow.pNaviGenlist);
struct appdata *ap = (struct appdata *)selected->ap;
mf_retm_if(ap == NULL, "input parameter data error");
int view_style = mf_view_style_get(ap);
- if (ap->mf_Status.more != MORE_EDIT
- && ap->mf_Status.more != MORE_SHARE_EDIT
- && ap->mf_Status.more != MORE_EDIT_COPY
- && ap->mf_Status.more != MORE_EDIT_MOVE
- && ap->mf_Status.more != MORE_EDIT_DELETE
- && ap->mf_Status.more != MORE_EDIT_DELETE_RECENT
- && ap->mf_Status.more != MORE_EDIT_UNINSTALL
- && ap->mf_Status.more != MORE_EDIT_DETAIL
- ) {
+ if (ap->mf_Status.more != MORE_EDIT
+ && ap->mf_Status.more != MORE_SHARE_EDIT
+ && ap->mf_Status.more != MORE_EDIT_COPY
+ && ap->mf_Status.more != MORE_EDIT_MOVE
+ && ap->mf_Status.more != MORE_EDIT_DELETE
+ && ap->mf_Status.more != MORE_EDIT_DELETE_RECENT
+ && ap->mf_Status.more != MORE_EDIT_UNINSTALL
+ && ap->mf_Status.more != MORE_EDIT_DETAIL
+ ) {
MF_TRACE_END;
- return;
- }
+ return;
+ }
if (selected->file_type == FILE_TYPE_DIR) {
if (mf_edit_folder_list_item_exists(item)) {
selected->m_checked = false;
int view_style = mf_view_style_get(ap);
if (ap->mf_Status.more != MORE_EDIT
- && ap->mf_Status.more != MORE_SHARE_EDIT
- && ap->mf_Status.more != MORE_EDIT_COPY
- && ap->mf_Status.more != MORE_EDIT_MOVE
- && ap->mf_Status.more != MORE_EDIT_DELETE
- && ap->mf_Status.more != MORE_EDIT_DELETE_RECENT
- && ap->mf_Status.more != MORE_EDIT_UNINSTALL
- && ap->mf_Status.more != MORE_EDIT_DETAIL
- ) {
+ && ap->mf_Status.more != MORE_SHARE_EDIT
+ && ap->mf_Status.more != MORE_EDIT_COPY
+ && ap->mf_Status.more != MORE_EDIT_MOVE
+ && ap->mf_Status.more != MORE_EDIT_DELETE
+ && ap->mf_Status.more != MORE_EDIT_DELETE_RECENT
+ && ap->mf_Status.more != MORE_EDIT_UNINSTALL
+ && ap->mf_Status.more != MORE_EDIT_DETAIL
+ ) {
return;
}
if (obj) {
Evas_Object *popup = evas_object_data_get(obj, "popup"); // Get popup
- if (popup) return; // If popup exists, do nothing
+ if (popup) {
+ return; // If popup exists, do nothing
+ }
}
if (selected->file_type == FILE_TYPE_DIR) {
if (itemData->file_type == FILE_TYPE_DIR) {
it = elm_gengrid_item_next_get(it);
elm_object_item_del(itemData->item);
- }else {
+ } else {
it = elm_gengrid_item_next_get(it);
}
- }else {
+ } else {
it = elm_gengrid_item_next_get(it);
}
}
} else if (ap->mf_Status.more == MORE_EDIT_DELETE_RECENT) {
mf_naviframe_right_save_button_create(ap->mf_MainWindow.pNaviBar, ap->mf_MainWindow.pNaviItem, mf_callback_delete_recent_files_confirm_cb, ap);
} else if (ap->mf_Status.more == MORE_EDIT_UNINSTALL) {
- #ifdef MYFILE_DOWNLOAD_APP_FEATURE
+#ifdef MYFILE_DOWNLOAD_APP_FEATURE
mf_naviframe_right_save_button_create(ap->mf_MainWindow.pNaviBar, ap->mf_MainWindow.pNaviItem, mf_download_app_uninstall_cb, ap);
- #endif
+#endif
} else if (ap->mf_Status.more == MORE_EDIT_DETAIL) {
mf_debug("detail callback");
mf_naviframe_right_save_button_create(ap->mf_MainWindow.pNaviBar, ap->mf_MainWindow.pNaviItem, mf_callback_details_cb, ap);
}
edit_count = elm_gengrid_items_count(ap->mf_MainWindow.pNaviGengrid);
}
-
+
if (view_style != MF_VIEW_STYLE_THUMBNAIL) {
elm_genlist_realized_items_update(ap->mf_MainWindow.pNaviGenlist);
} else {
}
mf_edit_view_select_all_layout_prepend(ap);
- if (count == edit_count)
+ if (count == edit_count) {
mf_edit_select_all_check_set(EINA_TRUE);
- else
+ } else {
mf_edit_select_all_check_set(EINA_FALSE);
+ }
mf_edit_view_title_button_set(ap);
mf_edit_select_all_set(EINA_FALSE);
mf_edit_count_set(0);
char *title = NULL;
-
+
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_TRUE, EINA_FALSE);
mf_edit_select_all_callback_set(mf_edit_item_sel_all_cb);
mf_edit_select_info_func_set(mf_edit_view_select_info_create);
- if(ap->mf_Status.extra != MORE_SEARCH) {
+ if (ap->mf_Status.extra != MORE_SEARCH) {
mf_edit_view_select_all_layout_prepend(ap);
title = g_strdup_printf(mf_util_get_text(MF_LABEL_SELECTED), 0);
} else {
- title =mf_util_get_text(MF_LABEL_SELECT_ITEMS);
+ title = mf_util_get_text(MF_LABEL_SELECT_ITEMS);
}
mf_edit_view_list_update(ap);
mf_navi_bar_title_content_set(ap, title);
mf_retvm_if(next == NULL, 0, "next is NULL");
if (elm_object_focus_allow_get(curr) != EINA_TRUE ||
- elm_object_focus_allow_get(next) != EINA_TRUE) {
+ elm_object_focus_allow_get(next) != EINA_TRUE) {
mf_debug("Input elm object is not focusable!");
return -1;
}
elm_gengrid_item_selected_set(item, EINA_FALSE);
}
- if (ap->mf_MainWindow.pLongpressPopup != NULL)
+ if (ap->mf_MainWindow.pLongpressPopup != NULL) {
return;
+ }
if (item != NULL) {
mfItemData_s *selected = (mfItemData_s *) elm_object_item_data_get(item);
mf_retm_if(selected->m_ItemName == NULL, "selected->m_ItemName is NULL");
mf_retm_if(selected->m_ItemName->str == NULL, "selected->m_ItemName->str is NULL");
- if (ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_EDIT_UNINSTALL
- || ap->mf_Status.more == MORE_EDIT_DETAIL
- ) {
+ if (ap->mf_Status.more == MORE_EDIT
+ || ap->mf_Status.more == MORE_SHARE_EDIT
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_EDIT_UNINSTALL
+ || ap->mf_Status.more == MORE_EDIT_DETAIL
+ ) {
return;
}
void mf_gengrid_realized(void *data, Evas_Object *obj, void *event_info)
{
-
+
mf_retm_if(data == NULL, "data is NULL");
struct appdata *ap = (struct appdata*)data;
-
+
if (ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_EDIT_UNINSTALL
- || ap->mf_Status.more == MORE_EDIT_DETAIL
- ) {
+ || ap->mf_Status.more == MORE_SHARE_EDIT
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_EDIT_UNINSTALL
+ || ap->mf_Status.more == MORE_EDIT_DETAIL
+ ) {
mf_list_data_t *list_data = (mf_list_data_t *)elm_object_item_data_get(event_info);
elm_object_item_signal_emit(event_info, "check,state,show", "");
if (list_data->m_checked) {
char *real_name = NULL;
fsNodeInfo *pNode = (fsNodeInfo *)pData;
- if (pNode == NULL)
+ if (pNode == NULL) {
continue;
+ }
real_name = g_strconcat(pNode->path, "/", pNode->name, NULL);
if (real_name == NULL) {
m_TempItem->list_type = pNode->list_type;
m_TempItem->ap = ap;
if (ap->mf_Status.more == MORE_INTERNAL_COPY_MOVE || ap->mf_Status.more == MORE_INTERNAL_COPY || ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS
- || ap->mf_Status.more == MORE_INTERNAL_MOVE || ap->mf_Status.more == MORE_DATA_COPYING || ap->mf_Status.more == MORE_DATA_MOVING) {
+ || ap->mf_Status.more == MORE_INTERNAL_MOVE || ap->mf_Status.more == MORE_DATA_COPYING || ap->mf_Status.more == MORE_DATA_MOVING) {
mf_debug();
it = elm_gengrid_item_append(grid, &gic, m_TempItem, NULL, NULL);
} else {
if (!strcmp(part, "elm.swallow.icon")) {
Evas_Object *thumb = NULL;
- if (!(params->real_thumb_flag && params->thumb_path)) {
- mf_genlist_get_thumbnail(params);
- }
+ if (!(params->real_thumb_flag && params->thumb_path)) {
+ mf_genlist_get_thumbnail(params);
+ }
if (params->file_type == FILE_TYPE_MUSIC || params->file_type == FILE_TYPE_SOUND) {
- if (params->thumb_path && mf_file_exists(params->thumb_path) && strcmp(params->thumb_path,MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB) == 0) {
+ if (params->thumb_path && mf_file_exists(params->thumb_path) && strcmp(params->thumb_path, MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB) == 0) {
SAFE_FREE_CHAR(params->thumb_path);
params->thumb_path = g_strdup(MF_ICON_MUSIC_THUMBNAIL);
params->thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
int isOriginalImage = (params->m_ItemName->str && params->thumb_path && strcmp(params->thumb_path, params->m_ItemName->str) == 0);
if (isOriginalImage == 0) {
mf_file_attr_get_file_size(params->thumb_path, &size);
- if (size < 4*1024*1024)
+ if (size < 4 * 1024 * 1024) {
elm_image_file_set(thumb, params->thumb_path, NULL);
- }else{
- if (g_is_refresh_at_grid == false)
+ }
+ } else {
+ if (g_is_refresh_at_grid == false) {
mf_view_refresh_thumbnail_for_other_memory(ap, ap->mf_FileOperation.file_list);
- else{
+ } else {
if (params->pNode && params->pNode->thumbnail_path) {//For supporting the otg thumbnail
mf_debug("params->pNode->thumbnail_path=%s", params->pNode->thumbnail_path);
thumb = elm_image_add(obj);
elm_image_fill_outside_set(thumb, EINA_TRUE);
elm_image_smooth_set(thumb, EINA_FALSE);
elm_image_file_set(thumb, params->pNode->thumbnail_path, NULL);
- }else if (params->thumb_path) {
+ } else if (params->thumb_path) {
thumb = elm_image_add(obj);
elm_image_prescale_set(thumb, MF_ICON_SIZE);
elm_image_fill_outside_set(thumb, EINA_TRUE);
elm_image_smooth_set(thumb, EINA_FALSE);
- if (params->file_type == FILE_TYPE_IMAGE)
+ if (params->file_type == FILE_TYPE_IMAGE) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_IMAGE);
- else if (params->file_type == FILE_TYPE_VIDEO)
+ } else if (params->file_type == FILE_TYPE_VIDEO) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_VIDEO);
- else
+ } else {
elm_image_file_set(thumb, params->thumb_path, NULL);
- }else{
+ }
+ } else {
return NULL;
}
}
g_is_refresh_at_grid = true;
}
} else {
- thumb = elm_image_add(obj);
- elm_image_prescale_set(thumb, MF_ICON_SIZE);
- elm_image_fill_outside_set(thumb, EINA_TRUE);
- elm_image_smooth_set(thumb, EINA_FALSE);
- //Checking file size, if more than 4M, don't display it, it will be very slow.
- off_t size = 0;//Comment it, for P140606-04570, some times at efl, it will crash at png file.
- int isOriginalImage = (params->m_ItemName->str && params->thumb_path && strcmp(params->thumb_path, params->m_ItemName->str) == 0);
- if (isOriginalImage == 0) {
- mf_file_attr_get_file_size(params->thumb_path, &size);
- if (size < 4*1024*1024)
- elm_image_file_set(thumb, params->thumb_path, NULL);
- }else{
- if (g_is_refresh_at_grid == false)
- mf_view_refresh_thumbnail_for_other_memory(ap, ap->mf_FileOperation.file_list);
- else{
- if (params->pNode && params->pNode->thumbnail_path) {//For supporting the otg thumbnail
- mf_debug("params->pNode->thumbnail_path=%s", params->pNode->thumbnail_path);
- thumb = elm_image_add(obj);
- elm_image_prescale_set(thumb, MF_ICON_SIZE);
- elm_image_fill_outside_set(thumb, EINA_TRUE);
- elm_image_smooth_set(thumb, EINA_FALSE);
- elm_image_file_set(thumb, params->pNode->thumbnail_path, NULL);
- }else if (params->thumb_path) {
- thumb = elm_image_add(obj);
- elm_image_prescale_set(thumb, MF_ICON_SIZE);
- elm_image_fill_outside_set(thumb, EINA_TRUE);
- elm_image_smooth_set(thumb, EINA_FALSE);
-
- if (params->file_type == FILE_TYPE_IMAGE)
- elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_IMAGE);
- else if (params->file_type == FILE_TYPE_VIDEO)
- elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_VIDEO);
- else
- elm_image_file_set(thumb, params->thumb_path, NULL);
- }else{
- return NULL;
+ thumb = elm_image_add(obj);
+ elm_image_prescale_set(thumb, MF_ICON_SIZE);
+ elm_image_fill_outside_set(thumb, EINA_TRUE);
+ elm_image_smooth_set(thumb, EINA_FALSE);
+ //Checking file size, if more than 4M, don't display it, it will be very slow.
+ off_t size = 0;//Comment it, for P140606-04570, some times at efl, it will crash at png file.
+ int isOriginalImage = (params->m_ItemName->str && params->thumb_path && strcmp(params->thumb_path, params->m_ItemName->str) == 0);
+ if (isOriginalImage == 0) {
+ mf_file_attr_get_file_size(params->thumb_path, &size);
+ if (size < 4 * 1024 * 1024) {
+ elm_image_file_set(thumb, params->thumb_path, NULL);
+ }
+ } else {
+ if (g_is_refresh_at_grid == false) {
+ mf_view_refresh_thumbnail_for_other_memory(ap, ap->mf_FileOperation.file_list);
+ } else {
+ if (params->pNode && params->pNode->thumbnail_path) {//For supporting the otg thumbnail
+ mf_debug("params->pNode->thumbnail_path=%s", params->pNode->thumbnail_path);
+ thumb = elm_image_add(obj);
+ elm_image_prescale_set(thumb, MF_ICON_SIZE);
+ elm_image_fill_outside_set(thumb, EINA_TRUE);
+ elm_image_smooth_set(thumb, EINA_FALSE);
+ elm_image_file_set(thumb, params->pNode->thumbnail_path, NULL);
+ } else if (params->thumb_path) {
+ thumb = elm_image_add(obj);
+ elm_image_prescale_set(thumb, MF_ICON_SIZE);
+ elm_image_fill_outside_set(thumb, EINA_TRUE);
+ elm_image_smooth_set(thumb, EINA_FALSE);
+
+ if (params->file_type == FILE_TYPE_IMAGE) {
+ elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_IMAGE);
+ } else if (params->file_type == FILE_TYPE_VIDEO) {
+ elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_VIDEO);
+ } else {
+ elm_image_file_set(thumb, params->thumb_path, NULL);
}
+ } else {
+ return NULL;
}
- g_is_refresh_at_grid = true;
}
+ g_is_refresh_at_grid = true;
+ }
}
elm_image_smooth_set(thumb, EINA_FALSE);
elm_image_preload_disabled_set(thumb, EINA_FALSE);
} else {
- return NULL;
+ return NULL;
}
if (params->file_type != FILE_TYPE_DIR) {
evas_object_show(thumb);
return thumb;
}
- return NULL;
+ return NULL;
}
char *mf_gengrid_item_label_get(void *data, Evas_Object * obj, const char *part)
mf_error("===================== label get entry");
if (ap->mf_Status.view_type == mf_view_root_category) {
- if (ap->mf_Status.more != MORE_SEARCH && mf_view_get_pre_state(ap) != MORE_SEARCH) {
- if (ap->mf_Status.category_type == mf_tray_item_category_image
- || ap->mf_Status.category_type == mf_tray_item_category_video) {
- if (params->thumbnail_type != MF_THUMBNAIL_DEFAULT) {
- is_apply_filename = false;
- }
+ if (ap->mf_Status.more != MORE_SEARCH && mf_view_get_pre_state(ap) != MORE_SEARCH) {
+ if (ap->mf_Status.category_type == mf_tray_item_category_image
+ || ap->mf_Status.category_type == mf_tray_item_category_video) {
+ if (params->thumbnail_type != MF_THUMBNAIL_DEFAULT) {
+ is_apply_filename = false;
}
+ }
}
}
if (is_apply_filename && strcmp(part, "elm.text") == 0) {
MF_TRACE_END;
file_name = g_strdup(markup_name);
}
- }
- else if (params->ap->mf_Status.iExtensionState == MF_EXTENSION_HIDE && !mf_file_attr_is_dir(params->m_ItemName->str)) {
+ } else if (params->ap->mf_Status.iExtensionState == MF_EXTENSION_HIDE && !mf_file_attr_is_dir(params->m_ItemName->str)) {
file_name = mf_fm_svc_get_file_name(params->m_ItemName);
} else {
file_name = g_strdup(mf_file_get(params->m_ItemName->str));
}
}
return file_name_tmp;
- }else{
+ } else {
if (file_name) {
char *translate_label = elm_entry_utf8_to_markup(file_name);
if (translate_label) {
}
return file_name;
}
- }else{
+ } else {
return strdup(_(""));
}
}
Evas_Object *grid = NULL;
grid = mf_gengrid_create_grid(parent);
int gengrid_len = eina_list_count(ap->mf_FileOperation.file_list) + eina_list_count(ap->mf_FileOperation.folder_list);
- mf_error("gengrid length = %d",gengrid_len);
+ mf_error("gengrid length = %d", gengrid_len);
mf_gengrid_align_set(grid, gengrid_len);
mf_gengrid_gen_style_set();
return grid;
}
-Evas_Object *mf_gengrid_create_grid (Evas_Object *parent)
+Evas_Object *mf_gengrid_create_grid(Evas_Object *parent)
{
MF_TRACE_BEGIN;
mf_retvm_if(parent == NULL, NULL, "parent is NULL");
//elm_object_focus_set(grid, EINA_FALSE);
elm_object_focus_allow_set(grid, EINA_TRUE);
- elm_gengrid_horizontal_set(grid, EINA_FALSE);
+ elm_gengrid_horizontal_set(grid, EINA_FALSE);
elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE);
elm_scroller_policy_set(grid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
- elm_gengrid_multi_select_set(grid, EINA_TRUE);
+ elm_gengrid_multi_select_set(grid, EINA_TRUE);
evas_object_show(grid);
g_is_refresh_at_grid = false;
return grid;
}
void mf_gengrid_create_list_default_style(Evas_Object *pGengrid, void *data, Eina_List *dir_list,
- Eina_List *file_list)
+ Eina_List *file_list)
{
MF_TRACE_BEGIN;
Eina_List *l = NULL;
EINA_LIST_FOREACH(dir_list, l, pNode) {
- if (pNode) {
- it = mf_view_item_append(pGengrid, pNode, ap);
- mf_error();
- if (ap->mf_Status.ToTop) {
- elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
- ap->mf_Status.ToTop = false ;
- }
- }
+ if (pNode) {
+ it = mf_view_item_append(pGengrid, pNode, ap);
+ mf_error();
+ if (ap->mf_Status.ToTop) {
+ elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ ap->mf_Status.ToTop = false ;
+ }
+ }
}
/* add file items into the genlist */
EINA_LIST_FOREACH(file_list, l, pNode) {
- if (pNode) {
- mf_view_item_append(pGengrid, pNode, ap);
- }
+ if (pNode) {
+ mf_view_item_append(pGengrid, pNode, ap);
+ }
}
}
void mf_gengrid_thumbs_longpressed(void *data, Evas_Object *obj,
- void *event_info)
+ void *event_info)
{
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
dir_list = ap->mf_FileOperation.folder_list;
}
- gengrid = mf_gengrid_create(parent,ap);
+ gengrid = mf_gengrid_create(parent, ap);
evas_object_smart_callback_add(gengrid, "language,changed", mf_gengrid_gl_lang_changed, ap);
#define DEF_LABEL_BUF_LEN (512)
#define MF_LIST_THUMBNAIL_SIZE 46
-typedef struct
-{
+typedef struct {
void *ap_data;
Evas_Object *layout;
Evas_Object *navi_layout;
Eina_List *file_list;
Evas_Object *navi_item;
Eina_Bool is_root;
-}cloud_view_data;
+} cloud_view_data;
/**** Global definition ****/
static bool g_is_refresh_at_glist = false;
}
int thumbnail_type = mf_file_attr_get_file_icon(params->m_ItemName->str, &error_code,
- MF_ROTATE_PORTRAIT, &icon_path, ¶ms->media);
+ MF_ROTATE_PORTRAIT, &icon_path, ¶ms->media);
if (icon_path && thumbnail_type == MF_THUMBNAIL_TYPE_THUMBNAIL) {
if (mf_file_exists(icon_path)) {
} else if (g_strcmp0(params->m_ItemName->str, MEMORY_FOLDER) == 0) {
return g_strdup(mf_util_get_text(MF_LABEL_SD_CARD));
} else {
- if (params->ap->mf_Status.more == MORE_SEARCH &¶ms->ap->mf_Status.search_filter) {
+ if (params->ap->mf_Status.more == MORE_SEARCH && params->ap->mf_Status.search_filter) {
char *markup_name = NULL;
bool res = false;
markup_name = (char *)mf_util_search_markup_keyword(mf_file_get(params->m_ItemName->str), params->ap->mf_Status.search_filter, &res);
}
}
/*
- } else if (strcmp(part, "elm.uptitle.text") == 0) {
- return g_strdup(params->m_ItemName->str);
- } else if (strcmp(part, "elm.slide_base.text") == 0) {
- return g_strdup(mf_file_get(params->m_ItemName->str));
- } else if (strcmp(part, "elm.slide.text.1") == 0) {
- return g_strdup(mf_file_get(params->m_ItemName->str));
+ } else if (strcmp(part, "elm.uptitle.text") == 0) {
+ return g_strdup(params->m_ItemName->str);
+ } else if (strcmp(part, "elm.slide_base.text") == 0) {
+ return g_strdup(mf_file_get(params->m_ItemName->str));
+ } else if (strcmp(part, "elm.slide.text.1") == 0) {
+ return g_strdup(mf_file_get(params->m_ItemName->str));
*/
} else if (strcmp(part, "elm.text.main.left.top") == 0) {
if (g_strcmp0(params->m_ItemName->str, PHONE_FOLDER) == 0) {
return g_strdup(mf_util_get_text(MF_LABEL_DEVICE_MEMORY));
} else if (g_strcmp0(params->m_ItemName->str, MEMORY_FOLDER) == 0) {
return g_strdup(mf_util_get_text(MF_LABEL_SD_CARD));
- } else if (params->ap->mf_Status.more == MORE_SEARCH &¶ms->ap->mf_Status.search_filter) {
+ } else if (params->ap->mf_Status.more == MORE_SEARCH && params->ap->mf_Status.search_filter) {
char *markup_name = NULL;
bool res = false;
markup_name = (char *)mf_util_search_markup_keyword(mf_file_get(params->m_ItemName->str), params->ap->mf_Status.search_filter, &res);
} else if (strcmp(part, "elm.text.sub.left.bottom") == 0) {
if ((params->ap->mf_Status.more == MORE_SEARCH && params->ap->mf_Status.search_filter)
- || params->ap->mf_Status.view_type == mf_view_root) {
+ || params->ap->mf_Status.view_type == mf_view_root) {
int root_len = 0;
char *new_path = NULL;
GString *parent_path = NULL;
} else {
if (params->create_date) {
if (params->list_type == mf_list_normal
- || params->list_type == mf_list_recent_files) {
+ || params->list_type == mf_list_recent_files) {
if (params->modify_time) {
char *tempdate = mf_util_icu_translate(params->ap, params->modify_time, false);
SAFE_FREE_CHAR(params->create_date);
if (count == 0 || count == 1) {
return g_strdup_printf(mf_util_get_text(MF_LABEL_ITEM), count);
} else {
- return g_strdup_printf("%d %s", count ,mf_util_get_text(MF_LABEL_ITEMS));
+ return g_strdup_printf("%d %s", count , mf_util_get_text(MF_LABEL_ITEMS));
}
} else {
return g_strdup(_(""));
}
} else if (!strcmp(part, "elm.icon.2")) {
if (ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE_RECENT
- || ap->mf_Status.more == MORE_EDIT_UNINSTALL
- || ap->mf_Status.more == MORE_EDIT_DETAIL)
- {
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE_RECENT
+ || ap->mf_Status.more == MORE_EDIT_UNINSTALL
+ || ap->mf_Status.more == MORE_EDIT_DETAIL) {
if (ap->mf_Status.extra != MORE_SEARCH) {
Evas_Object *content = elm_layout_add(obj);
elm_layout_theme_set(content, "layout", "list/C/type.2", "default");
if (params->file_type == FILE_TYPE_MUSIC || params->file_type == FILE_TYPE_SOUND) {
if (params->thumb_path && mf_file_exists(params->thumb_path) &&
- strcmp(params->thumb_path, MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB) == 0) {
+ strcmp(params->thumb_path, MF_MUSIC_DEFAULT_THUMBNAIL_FROM_DB) == 0) {
SAFE_FREE_CHAR(params->thumb_path);
- if (params->file_type == FILE_TYPE_MUSIC)
+ if (params->file_type == FILE_TYPE_MUSIC) {
params->thumb_path = g_strdup(MF_ICON_MUSIC_THUMBNAIL);
- else
+ } else {
params->thumb_path = g_strdup(MF_ICON_SOUND);
+ }
params->thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
} else {
- if (params->file_type == FILE_TYPE_MUSIC)
+ if (params->file_type == FILE_TYPE_MUSIC) {
params->thumb_path = g_strdup(MF_ICON_MUSIC_THUMBNAIL);
- else
+ } else {
params->thumb_path = g_strdup(MF_ICON_SOUND);
+ }
params->thumbnail_type = MF_THUMBNAIL_TYPE_DEFAULT;
}
bool is_phone_or_mmc = (params->storage_type == MYFILE_PHONE || params->storage_type == MYFILE_MMC);
bool is_using_original_image_at_phone_or_mmc =
- (params->thumbnail_type == MF_THUMBNAIL_DEFAULT && params->file_type == FILE_TYPE_IMAGE &&
- is_phone_or_mmc && params->m_ItemName->str);
+ (params->thumbnail_type == MF_THUMBNAIL_DEFAULT && params->file_type == FILE_TYPE_IMAGE &&
+ is_phone_or_mmc && params->m_ItemName->str);
if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT && (is_using_original_image_at_phone_or_mmc == false)) {
mf_debug("1");
off_t size = 0;
int isOriginalImage = (params->m_ItemName->str && params->thumb_path &&
- strcmp(params->thumb_path, params->m_ItemName->str) == 0);
+ strcmp(params->thumb_path, params->m_ItemName->str) == 0);
if (isOriginalImage == 0) {
mf_file_attr_get_file_size(params->thumb_path, &size);
- if (size < 4*1024*1024) {
+ if (size < 4 * 1024 * 1024) {
elm_image_file_set(thumb, EDJ_IMAGE, params->thumb_path);
//elm_object_part_content_set(layout, "default_thumbnail", thumb);
//elm_layout_content_set(layout, "elm.swallow.content", thumb);
mf_debug("22");
thumb = elm_image_add(obj);
elm_image_fill_outside_set(thumb, EINA_TRUE);
- if (params->file_type == FILE_TYPE_IMAGE)
+ if (params->file_type == FILE_TYPE_IMAGE) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_IMAGE);
- else if (params->file_type == FILE_TYPE_VIDEO)
+ } else if (params->file_type == FILE_TYPE_VIDEO) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_VIDEO);
- else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT)
+ } else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT) {
elm_image_file_set(thumb, EDJ_IMAGE, params->thumb_path);
+ }
elm_image_smooth_set(thumb, EINA_FALSE);
elm_image_preload_disabled_set(thumb, EINA_FALSE);
//elm_object_part_content_set(layout, "default_thumbnail", thumb);
mf_debug("51");
//Checking file size, if more than 4M, don't display it, it will be very slow.
/*off_t size = 0;//Comment it, for P140606-04570, some times at efl, it will crash at png file.
- mf_file_attr_get_file_size(params->m_ItemName->str, &size);
- if (size < 4*1024*1024)
- elm_image_file_set(thumb, params->m_ItemName->str, NULL);*/
- if (g_is_refresh_at_glist == false)
+ mf_file_attr_get_file_size(params->m_ItemName->str, &size);
+ if (size < 4*1024*1024)
+ elm_image_file_set(thumb, params->m_ItemName->str, NULL);*/
+ if (g_is_refresh_at_glist == false) {
mf_view_refresh_thumbnail_for_other_memory(ap, ap->mf_FileOperation.file_list);
- else {
+ } else {
mf_debug("52");
if (params->pNode && params->pNode->thumbnail_path) {//For supporting the otg thumbnail
mf_debug("53");
mf_debug("54");
thumb = elm_image_add(obj);
elm_image_fill_outside_set(thumb, EINA_TRUE);
- if (params->file_type == FILE_TYPE_IMAGE)
+ if (params->file_type == FILE_TYPE_IMAGE) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_IMAGE);
- else if (params->file_type == FILE_TYPE_VIDEO)
+ } else if (params->file_type == FILE_TYPE_VIDEO) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_VIDEO);
- else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT)
+ } else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT) {
elm_image_file_set(thumb, EDJ_IMAGE, params->thumb_path);
+ }
elm_image_smooth_set(thumb, EINA_FALSE);
elm_image_preload_disabled_set(thumb, EINA_FALSE);
//elm_layout_content_set(layout, "elm.swallow.content", thumb);
Evas_Object *thumb = elm_image_add(obj);
elm_image_fill_outside_set(thumb, EINA_TRUE);
elm_image_smooth_set(thumb, EINA_FALSE);
- if (params->file_type == FILE_TYPE_MUSIC || params->file_type == FILE_TYPE_SOUND)
+ if (params->file_type == FILE_TYPE_MUSIC || params->file_type == FILE_TYPE_SOUND) {
elm_image_file_set(thumb, EDJ_IMAGE, params->thumb_path);
- else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT)
+ } else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT) {
elm_image_file_set(thumb, EDJ_IMAGE, params->thumb_path);
- else
+ } else {
elm_image_file_set(thumb, params->thumb_path, NULL);
+ }
evas_object_show(thumb);
return thumb;
}
return layout;
}
- if(strstr(params->m_ItemName->str, "/.") != NULL) {
- if (params->file_type == FILE_TYPE_IMAGE)
+ if (strstr(params->m_ItemName->str, "/.") != NULL) {
+ if (params->file_type == FILE_TYPE_IMAGE) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_IMAGE);
- else if (params->file_type == FILE_TYPE_VIDEO)
+ } else if (params->file_type == FILE_TYPE_VIDEO) {
elm_image_file_set(thumb, EDJ_IMAGE, MF_ICON_VIDEO);
- else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT)
+ } else if (params->thumbnail_type == MF_THUMBNAIL_DEFAULT) {
elm_image_file_set(thumb, EDJ_IMAGE, params->thumb_path);
+ }
elm_image_smooth_set(thumb, EINA_FALSE);
}
return edit_field;
} else if (!strcmp(part, "elm.flip.eraser")) {
layout = mf_object_create_button(obj, "editfield_clear", NULL, NULL,
- (Evas_Smart_Cb)__genlist_rename_eraser_clicked_cb, params, EINA_FALSE);
+ (Evas_Smart_Cb)__genlist_rename_eraser_clicked_cb, params, EINA_FALSE);
return layout;
} else if (!strcmp(part, "elm.flip.icon")) {
Evas_Object *cancel_btn = mf_object_create_button(obj, NULL, LABEL_CANCEL, NULL,
- (Evas_Smart_Cb)mf_callback_cancel_cb, params->ap, EINA_FALSE);
+ (Evas_Smart_Cb)mf_callback_cancel_cb, params->ap, EINA_FALSE);
evas_object_size_hint_min_set(cancel_btn, ELM_SCALE_SIZE(140), 0);
evas_object_show(cancel_btn);
evas_object_propagate_events_set(cancel_btn, EINA_FALSE);
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
Elm_Object_Item *item = (Elm_Object_Item *) event_info;
- if (item)
+ if (item) {
elm_genlist_item_selected_set(item, FALSE);
+ }
Evas_Object *popup = evas_object_data_get(obj, "popup");
if (popup) {
elm_genlist_item_selected_set(item, FALSE);
if (ap->mf_Status.more == MORE_EDIT_RENAME) {
- if (ap->mf_Status.view_type == mf_view_root)
+ if (ap->mf_Status.view_type == mf_view_root) {
return;
+ }
ap->mf_FileOperation.rename_item = item;
mf_callback_idle_rename(selected);
} else if (ap->mf_Status.more == MORE_RENAME) {
mf_callback_rename_save_cb(ap, NULL, NULL);
return;
- } else if (ap->mf_Status.more != MORE_EDIT
- && ap->mf_Status.more != MORE_SHARE_EDIT
- && ap->mf_Status.more != MORE_EDIT_COPY
- && ap->mf_Status.more != MORE_EDIT_MOVE
- && ap->mf_Status.more != MORE_EDIT_DETAIL
- && ap->mf_Status.more != MORE_EDIT_DELETE
- && ap->mf_Status.more != MORE_EDIT_DELETE_RECENT
- ) {
+ } else if (ap->mf_Status.more != MORE_EDIT
+ && ap->mf_Status.more != MORE_SHARE_EDIT
+ && ap->mf_Status.more != MORE_EDIT_COPY
+ && ap->mf_Status.more != MORE_EDIT_MOVE
+ && ap->mf_Status.more != MORE_EDIT_DETAIL
+ && ap->mf_Status.more != MORE_EDIT_DELETE
+ && ap->mf_Status.more != MORE_EDIT_DELETE_RECENT
+ ) {
if (selected->storage_type == MYFILE_PHONE
- || selected->storage_type == MYFILE_MMC
- ) {
+ || selected->storage_type == MYFILE_MMC
+ ) {
if (!mf_file_exists(selected->m_ItemName->str)) {
mf_popup_indicator_popup(NULL, mf_util_get_text(MF_LABEL_FILE_NOT_EXIST));
elm_object_item_del(selected->item);
mf_retv_if(pStorage == NULL, NULL);
if (!strcmp(part, "elm.text.main.left")) {
- mf_debug("%s ",pStorage->root_name);
+ mf_debug("%s ", pStorage->root_name);
return elm_entry_utf8_to_markup(pStorage->root_name);
} else if (!strcmp(part, "elm.text.sub")) {
char storage_size[256];
mf_retm_if(genlist == NULL, "genlist is NULL");
mf_retm_if(file_list == NULL, "file_list is NULL");
- EINA_LIST_FOREACH(file_list, list, item)
- {
+ EINA_LIST_FOREACH(file_list, list, item) {
Elm_Object_Item *node_item = NULL;
Elm_Genlist_Item_Class *itc_cloud = NULL;
itc_cloud = elm_genlist_item_class_new();
if (itc_cloud != NULL) {
- itc_cloud->item_style= "1line";
+ itc_cloud->item_style = "1line";
itc_cloud->func.text_get = __mf_genlist_widget_storage_label_get;
itc_cloud->func.content_get = __mf_genlist_widget_storage_content_get;
- node_item = elm_genlist_item_append(genlist, itc_cloud, item, NULL,ELM_GENLIST_ITEM_NONE, __mf_genlist_widget_storage_selected_cb, ap);
+ node_item = elm_genlist_item_append(genlist, itc_cloud, item, NULL, ELM_GENLIST_ITEM_NONE, __mf_genlist_widget_storage_selected_cb, ap);
elm_object_item_data_set(node_item, item);
}
}
if (*itc == NULL) {
mf_error("new item class ==================== itc_type is [%d]", itc_type);
*itc = elm_genlist_item_class_new();
- if (*itc == NULL)
+ if (*itc == NULL) {
return;
+ }
}
int view_style = mf_view_style_get(ap);
mf_debug("itc type : %d, view style : %d", itc_type, view_style);
case mf_item_itc_type_recent:
if (view_style == MF_VIEW_SYTLE_LIST_DETAIL) {
(*itc)->item_style = "myfile_2line.top.3";
- }else{
+ } else {
(*itc)->item_style = "myfile_1line";
}
(*itc)->func.text_get = __mf_genlist_gl_label_get_lite;
}
void mf_genlist_create_list_default_style(Evas_Object *pGenlist, void *data, Eina_List *dir_list,
- Eina_List *file_list)
+ Eina_List *file_list)
{
MF_TRACE_BEGIN;
/*0. variable definition and parameter check*/
elm_genlist_realized_items_update(obj);
}
-Evas_Object *mf_genlist_create_list(void *data,Evas_Object *parent)
+Evas_Object *mf_genlist_create_list(void *data, Evas_Object *parent)
{
MF_TRACE_BEGIN;
t_start;
static void _index_clicked(void *data, Evas_Object *obj, const char *em, const char *src)
{
- if (!obj)
+ if (!obj) {
return;
+ }
mf_error(" >>>>>>>>>>>>>> obj is [%p]", obj);
elm_object_signal_emit(obj, "elm,state,slide,start", "");
}
{
struct appdata *ap = mf_get_appdata();
if (!(ap->mf_Status.more == MORE_DEFAULT
- || ap->mf_Status.more == MORE_INTERNAL_COPY
- || ap->mf_Status.more == MORE_INTERNAL_MOVE
- ))
- {
+ || ap->mf_Status.more == MORE_INTERNAL_COPY
+ || ap->mf_Status.more == MORE_INTERNAL_MOVE
+ )) {
return;
}
char *fullpath = (char *)data;
if (g_strcmp0(ap->mf_Status.path->str, fullpath) == 0) {
mf_error("The same folder selected");
return;
- }
- else {
+ } else {
if (!mf_file_exists(fullpath)) {
SAFE_FREE_GSTRING(ap->mf_Status.path);
ap->mf_Status.path = g_string_new(PHONE_FOLDER);
if (ap->mf_Status.view_type == mf_view_storage) {
label = MF_LABEL_LOCAL_STORAGE;
} else if (ap->mf_Status.view_type == mf_view_recent && ap->mf_Status.more == MORE_DEFAULT) {
- label = MF_LABEL_RECTENT_FILES;
+ label = MF_LABEL_RECTENT_FILES;
} else if (ap->mf_Status.view_type == mf_view_root_category && ap->mf_Status.categorytitle && ap->mf_Status.more == MORE_DEFAULT) {
- label = ap->mf_Status.categorytitle;
+ label = ap->mf_Status.categorytitle;
} else {
switch (location) {
case MYFILE_PHONE:
struct dirent *ent = NULL;
while ((readdir_r(pDir, &ent_struct, &ent) == 0) && ent) {
int skip = ((strncmp(ent->d_name, ".", 1) == 0) ||
- (strncmp(ent->d_name, "..", 2) == 0));
+ (strncmp(ent->d_name, "..", 2) == 0));
skip = skip || ((ent->d_type != DT_DIR) && (ent->d_type != DT_REG));
skip = skip || ((ent->d_type == DT_DIR) &&
- (strcmp(dir_path, PHONE_FOLDER) == 0) &&
- (strcmp(ent->d_name, DEBUG_FOLDER) == 0));
+ (strcmp(dir_path, PHONE_FOLDER) == 0) &&
+ (strcmp(ent->d_name, DEBUG_FOLDER) == 0));
node_info *const pNode = skip ? NULL : calloc(1, sizeof(node_info));
if (pNode) {
Eina_List *list = NULL;
void *item = NULL;
- EINA_LIST_FOREACH(storage_list, list, item)
- {
+ EINA_LIST_FOREACH(storage_list, list, item) {
storage_info *info = item;
if ((info->type != STORAGE_TYPE_LABEL) && (!strcmp(info->root_path, fullpath))) {
return info->type;
char *title = __mf_genlist_cloud_title_get(cloud_data->curr_path, ap->storage_list);
if (ap->mf_Status.pPreNaviItem) {
ap->mf_MainWindow.pNaviItem = elm_naviframe_item_insert_after(ap->mf_MainWindow.pNaviBar,
- ap->mf_Status.pPreNaviItem,
- "", NULL, NULL,
- cloud_data->navi_layout,
- MF_NAVI_STYLE_ENABLE);
+ ap->mf_Status.pPreNaviItem,
+ "", NULL, NULL,
+ cloud_data->navi_layout,
+ MF_NAVI_STYLE_ENABLE);
} else {
ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(ap->mf_MainWindow.pNaviBar,
- title, NULL, NULL,
- cloud_data->navi_layout,
- MF_NAVI_STYLE_ENABLE);
+ title, NULL, NULL,
+ cloud_data->navi_layout,
+ MF_NAVI_STYLE_ENABLE);
}
mf_navi_add_back_button(ap, mf_callback_navi_backbutton_clicked_cb);
free(title);
node_info *pNode = (node_info *)data;
if (!strcmp(part, "elm.text.main.left")) {
- mf_debug("%s ",pNode->name);
+ mf_debug("%s ", pNode->name);
return elm_entry_utf8_to_markup(pNode->name);
} else {
return NULL;
const Eina_List *list = NULL;
void *item = NULL;
- EINA_LIST_FOREACH(file_list, list, item)
- {
+ EINA_LIST_FOREACH(file_list, list, item) {
Elm_Object_Item *node_item;
Elm_Genlist_Item_Class *itc_cloud;
itc_cloud = elm_genlist_item_class_new();
if (itc_cloud != NULL) {
- itc_cloud->item_style= "1line";
+ itc_cloud->item_style = "1line";
itc_cloud->func.text_get = __mf_genlist_widget_cloud_item_label_get;
itc_cloud->func.content_get = __mf_genlist_widget_cloud_item_content_get;
- node_item = elm_genlist_item_append(genlist, itc_cloud, item, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ node_item = elm_genlist_item_append(genlist, itc_cloud, item, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_object_item_data_set(node_item, item);
}
}
_mf_navi_bar_create_content_set_focus(ap, pContent);
if (ap->mf_Status.more == MORE_DEFAULT
- || ap->mf_Status.more == MORE_INTERNAL_COPY
- || ap->mf_Status.more == MORE_INTERNAL_MOVE) {
+ || ap->mf_Status.more == MORE_INTERNAL_COPY
+ || ap->mf_Status.more == MORE_INTERNAL_MOVE) {
mf_fs_monitor_add_dir_watch(ap->mf_Status.path->str, ap);
}
t_end;
struct appdata *ap = (struct appdata *)data;
mf_navi_bar_clean_content(data, pLayout);
-
+
ap->mf_MainWindow.pNaviBox = mf_object_create_box(ap->mf_MainWindow.pNaviLayout);
mf_navi_bar_layout_content_set(ap->mf_MainWindow.pNaviLayout, ap->mf_MainWindow.pNaviBox);
evas_object_show(home_ic);
Evas_Object *home_btn = mf_object_create_button(parent,
- "naviframe/title_icon",
- NULL,
- home_ic,
- func,
- user_data,
- EINA_FALSE);
+ "naviframe/title_icon",
+ NULL,
+ home_ic,
+ func,
+ user_data,
+ EINA_FALSE);
return home_btn;
}
elm_image_file_set(image, EDJ_IMAGE, MF_TITLE_ICON_SEARCH);
elm_image_resizable_set(image, EINA_TRUE, EINA_TRUE);
evas_object_show(image);
-
+
Evas_Object *up_btn = mf_object_create_button(parent,
- "naviframe/title_icon",
- NULL,
- image,
- func,
- user_data,
- EINA_FALSE);
+ "naviframe/title_icon",
+ NULL,
+ image,
+ func,
+ user_data,
+ EINA_FALSE);
return up_btn;
}
evas_object_show(up_ic);
Evas_Object *up_btn = mf_object_create_button(parent,
- "naviframe/title_icon",
- NULL,
- up_ic,
- func,
- user_data,
- EINA_FALSE);
+ "naviframe/title_icon",
+ NULL,
+ up_ic,
+ func,
+ user_data,
+ EINA_FALSE);
return up_btn;
}
evas_object_show(select_ic);
Evas_Object *select_btn = mf_object_create_button(parent,
- "naviframe/title_icon",
- NULL,
- select_ic,
- func,
- user_data,
- EINA_FALSE);
+ "naviframe/title_icon",
+ NULL,
+ select_ic,
+ func,
+ user_data,
+ EINA_FALSE);
return select_btn;
}
char *title = NULL;
if (ap->mf_Status.more == MORE_SEARCH
- || ap->mf_Status.more == MORE_EDIT
- || ap->mf_Status.more == MORE_SHARE_EDIT
- || ap->mf_Status.more == MORE_EDIT_DETAIL
- || ap->mf_Status.more == MORE_EDIT_COPY
- || ap->mf_Status.more == MORE_EDIT_MOVE
- || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_EDIT_DELETE_RECENT
+ || ap->mf_Status.more == MORE_EDIT
+ || ap->mf_Status.more == MORE_SHARE_EDIT
+ || ap->mf_Status.more == MORE_EDIT_DETAIL
+ || ap->mf_Status.more == MORE_EDIT_COPY
+ || ap->mf_Status.more == MORE_EDIT_MOVE
+ || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_EDIT_DELETE_RECENT
) {
if (more == MORE_EDIT) {
title = MF_LABEL_SELECT_ITEMS;
elm_object_item_part_content_set(navi_it, TITLE_RIGHT_BTN, search_btn);
}
} else if (ap->mf_Status.view_type == mf_view_root && more == MORE_DEFAULT) {
- Evas_Object *search_btn = mf_navi_bar_search_button_create(pNavi, mf_search_bar_enter_search_routine, ap);
- unset = elm_object_item_part_content_unset(navi_it, TITLE_RIGHT_BTN);
- SAFE_FREE_OBJ(unset);
- elm_object_item_part_content_set(navi_it, TITLE_RIGHT_BTN, search_btn);
+ Evas_Object *search_btn = mf_navi_bar_search_button_create(pNavi, mf_search_bar_enter_search_routine, ap);
+ unset = elm_object_item_part_content_unset(navi_it, TITLE_RIGHT_BTN);
+ SAFE_FREE_OBJ(unset);
+ elm_object_item_part_content_set(navi_it, TITLE_RIGHT_BTN, search_btn);
}
if ((ap->mf_Status.view_type == mf_view_root_category) && (ap->mf_Status.categorytitle != NULL)) {
- mf_error("ap->mf_Status.categorytitle = %s",ap->mf_Status.categorytitle);
+ mf_error("ap->mf_Status.categorytitle = %s", ap->mf_Status.categorytitle);
title = ap->mf_Status.categorytitle ;
Evas_Object *search_btn = mf_navi_bar_search_button_create(pNavi, mf_search_bar_enter_search_routine, ap);
unset = elm_object_item_part_content_unset(navi_it, TITLE_RIGHT_BTN);
return btn;
}
-void mf_navi_add_back_button(void *data, Eina_Bool (*func)(void *data, Elm_Object_Item *it))
+void mf_navi_add_back_button(void *data, Eina_Bool(*func)(void *data, Elm_Object_Item *it))
{
MF_TRACE_BEGIN;
mf_retm_if(data == NULL, "data is NULL");
//toolbar = mf_object_toolbar_create(ap->mf_MainWindow.pNaviBar);
//mf_object_item_tabbar_item_append(toolbar, NULL, LABEL_CANCEL, mf_callback_cancel_cb, ap);
//mf_object_item_tabbar_item_append(toolbar, NULL, LABEL_SHARE, mf_callback_share_cb, ap);
- break;
+ break;
case MORE_INTERNAL_DECOMPRESS:
if (ap->mf_Status.view_type != mf_view_root) {
//mf_object_item_tabbar_item_append(toolbar, NULL, LABEL_CANCEL, mf_callback_cancel_cb, ap);
//mf_object_item_tabbar_item_append(toolbar, NULL, MF_LABEL_DECOMPRESS_HERE, mf_callback_decompress_here_cb, ap);
}
- break;
+ break;
default:
break;
}
evas_object_event_callback_add(more_bt, EVAS_CALLBACK_KEY_DOWN, mf_callback_more_keydown_cb, ap);
}
//Prevent issue fix
-/* if (toolbar) {
- ap->mf_MainWindow.pNaviCtrlBar = toolbar;
- elm_object_item_part_content_set(navi_it, NAVI_CTRL_PART, toolbar);
-
- elm_object_focus_allow_set(ap->mf_MainWindow.pNaviCtrlBar, EINA_TRUE);
- }*/
+ /* if (toolbar) {
+ ap->mf_MainWindow.pNaviCtrlBar = toolbar;
+ elm_object_item_part_content_set(navi_it, NAVI_CTRL_PART, toolbar);
+
+ elm_object_focus_allow_set(ap->mf_MainWindow.pNaviCtrlBar, EINA_TRUE);
+ }*/
elm_object_item_signal_callback_add(navi_it, "elm,action,more_event", "", mf_callback_hardkey_more_cb, ap);
t_end;
MF_TRACE_END;
void
my_elm_object_item_disabled_set(Evas_Object *ctrlbar, Elm_Object_Item *it, Eina_Bool disabled)
-{//Fixed P131025-04748 by jian12.li.
+{
+ //Fixed P131025-04748 by jian12.li.
MF_TRACE_BEGIN;
const char *button_label = elm_object_item_part_text_get(it, NAVI_CTRL_TEXT_PART);
mf_error("my_elm_object_item_disabled_set button_label is [%s]", button_label);
elm_object_focus_allow_set(ctrlbar, false);
//elm_object_focus_allow_set(it, false);
}
- MF_TRACE_END;
+ MF_TRACE_END;
}
void mf_navi_bar_set_ctrlbar_item_disable(Elm_Object_Item *navi_it, int disable_item, bool disable)
}
}
if (ap->mf_Status.more == MORE_DEFAULT
- || ap->mf_Status.more == MORE_INTERNAL_COPY
- || ap->mf_Status.more == MORE_INTERNAL_MOVE) {
+ || ap->mf_Status.more == MORE_INTERNAL_COPY
+ || ap->mf_Status.more == MORE_INTERNAL_MOVE) {
mf_fs_monitor_add_dir_watch(ap->mf_Status.path->str, ap);
}
t_end;
}
Evas_Object *mf_naviframe_left_cancel_button_create(Evas_Object *pParent, Elm_Object_Item *pNaviItem,
- Evas_Smart_Cb pFunc, void *pUserData)
+ Evas_Smart_Cb pFunc, void *pUserData)
{
Evas_Object *btn = elm_button_add(pParent);
elm_object_style_set(btn, "naviframe/title_left");
}
Evas_Object *mf_naviframe_right_save_button_create(Evas_Object *pParent, Elm_Object_Item *pNaviItem,
- Evas_Smart_Cb pFunc, void *pUserData)
+ Evas_Smart_Cb pFunc, void *pUserData)
{
struct appdata *ap = (struct appdata *)pUserData;
Evas_Object *btn = elm_button_add(pParent);
} else if (ap->mf_Status.more == MORE_EDIT_RENAME) {
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_TRUE, EINA_FALSE);
mf_navi_bar_title_content_set(ap, LABEL_RENAME);
- }
- else {
- mf_navi_bar_title_content_set(ap,ap->mf_MainWindow.naviframe_title);
+ } else {
+ mf_navi_bar_title_content_set(ap, ap->mf_MainWindow.naviframe_title);
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_TRUE, EINA_TRUE);
}
//mf_navi_bar_title_set(ap);
mf_retm_if(item == NULL, "item is NULL");
const char *domain;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
domain = PKGNAME_SYSTEM;
- else
- domain = NULL;//PKGNAME_MYFILE;
+ } else {
+ domain = NULL; //PKGNAME_MYFILE;
+ }
elm_object_item_domain_translatable_part_text_set(item, part, domain, ID);
MF_TRACE_END;
}
mf_retm_if(item == NULL, "item is NULL");
const char *domain;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
domain = PKGNAME_SYSTEM;
- else
+ } else {
domain = NULL;
+ }
SECURE_DEBUG(">>>>>>>>>>>>>>> ID is [%s] domain is [%s]", ID, domain);
elm_object_item_domain_text_translatable_set(item, domain, EINA_TRUE);
}
Elm_Object_Item *mf_object_item_tabbar_item_append(Evas_Object *obj,
- const char *icon,
- const char *label,
- Evas_Smart_Cb func,
- const void *data)
+ const char *icon,
+ const char *label,
+ Evas_Smart_Cb func,
+ const void *data)
{
Elm_Object_Item *item = elm_toolbar_item_append(obj, icon, label, func, data);
while (item) {
button_label = elm_object_item_part_text_get(item, NAVI_CTRL_TEXT_PART);
if (g_strcmp0(button_label, mf_util_get_text(label)) == 0
- || g_strcmp0(button_label, (label)) == 0)
+ || g_strcmp0(button_label, (label)) == 0) {
elm_object_item_disabled_set(item, disable);
+ }
button_label = NULL;
item = elm_toolbar_item_next_get(item);
}
}
Elm_Object_Item *mf_object_list_item_append(Evas_Object *parent,
- void *obj_data,
- void (*func)(void *data, Evas_Object * obj, void *event_info),
- void *func_data,
- void *user_data)
+ void *obj_data,
+ void (*func)(void *data, Evas_Object * obj, void *event_info),
+ void *func_data,
+ void *user_data)
{
MF_TRACE_BEGIN;
mf_retvm_if(parent == NULL, NULL, "parent error");
} else {
Elm_Gengrid_Item_Class *gitc = NULL;
//Prevent issue fix
- gitc = &gic;
- /* if (ap->mf_Status.view_type == mf_view_root_category) {
- gitc = &gic;
- } else {
- gitc = &gic;
- }*/
+ gitc = &gic;
+ /* if (ap->mf_Status.view_type == mf_view_root_category) {
+ gitc = &gic;
+ } else {
+ gitc = &gic;
+ }*/
it = elm_genlist_item_append(parent, gitc, obj_data, NULL, ELM_GENLIST_ITEM_NONE, func, func_data);
}
if (genlist) {
int posret = 0;
- it =elm_genlist_at_xy_item_get(genlist, x, y, &posret);
+ it = elm_genlist_at_xy_item_get(genlist, x, y, &posret);
}
return it;
}
}
Evas_Object *mf_object_create_button(Evas_Object *parent, const char *style,
- const char *caption, Evas_Object *icon,
- Evas_Smart_Cb func,
- void *data,
- Eina_Bool flag_propagate)
+ const char *caption, Evas_Object *icon,
+ Evas_Smart_Cb func,
+ void *data,
+ Eina_Bool flag_propagate)
{
- if (!parent)
+ if (!parent) {
return NULL;
+ }
Evas_Object *btn;
mf_object_text_set(btn, caption, NULL);
}
- if (icon)
+ if (icon) {
elm_object_content_set(btn, icon);
+ }
evas_object_propagate_events_set(btn, flag_propagate);
mf_retm_if(obj == NULL, "obj is NULL");
const char *domain;
- if (strstr(ID, "IDS_COM"))
+ if (strstr(ID, "IDS_COM")) {
domain = PKGNAME_SYSTEM;
- else
- domain = NULL;//PKGNAME_MYFILE;
+ } else {
+ domain = NULL; //PKGNAME_MYFILE;
+ }
elm_object_domain_translatable_part_text_set(obj, part, domain, ID);
//elm_object_domain_part_text_translatable_set(obj, part, domain, EINA_TRUE);
}
-Evas_Object *mf_object_create_select_all_btn(Evas_Object *parent,void *data)
+Evas_Object *mf_object_create_select_all_btn(Evas_Object *parent, void *data)
{
mf_retvm_if(parent == NULL, NULL, "parent is NULL");
}
void mf_object_create_select_all_layout(Evas_Object *pParent, Evas_Smart_Cb pChangeFunc,
- Evas_Object_Event_Cb pMouseDownFunc, void *pUserData, Evas_Object **pCheckBox, Evas_Object **pSelectLayout)
+ Evas_Object_Event_Cb pMouseDownFunc, void *pUserData, Evas_Object **pCheckBox, Evas_Object **pSelectLayout)
{
Evas_Object *pSelectAllLayout = elm_layout_add(pParent);
//elm_layout_theme_set(pSelectAllLayout, "genlist", "item", "select_all/default");
void mf_popup_entry_string_set(char *string)
{
SAFE_FREE_CHAR(entry_string);
- if (string)
+ if (string) {
entry_string = g_strdup(string);
+ }
}
char *mf_popup_entry_string_get()
}
static void __gl_popup_viewby_radio_smart_cb(void *data,
- Evas_Object *obj,
- void *vi)
+ Evas_Object *obj,
+ void *vi)
{
MF_TRACE_BEGIN;
mf_debug("radio show has finished by smart callback.");
ListByData_s *params = (ListByData_s *) data;
- if (params == NULL)
+ if (params == NULL) {
return;
+ }
__mf_popup_view_as_genlist_change(params);
MF_TRACE_END;
}
MF_TRACE_BEGIN;
mf_debug("radio show has finished by signal callback.");
ListByData_s *params = (ListByData_s *) data;
- if (params == NULL)
+ if (params == NULL) {
return;
+ }
__mf_popup_view_as_genlist_change(params);
MF_TRACE_END;
}
evas_object_smart_callback_add(radio, "changed", __gl_popup_viewby_radio_smart_cb, params);
elm_object_signal_callback_add(radio, "elm,action,radio,toggle", "",
- __gl_popup_viewby_radio_signal_cb, params);
+ __gl_popup_viewby_radio_signal_cb, params);
evas_object_show(radio);
return radio;
}
struct appdata *ap = (struct appdata *)data;
if (ap->mf_Status.more == MORE_SEARCH ||
- (ap->mf_Status.view_type == mf_view_root_category && ap->mf_Status.more != MORE_SEARCH)) {
- if (ap->mf_Status.flagSearchStart) {
+ (ap->mf_Status.view_type == mf_view_root_category && ap->mf_Status.more != MORE_SEARCH)) {
+ if (ap->mf_Status.flagSearchStart) {
//mf_search_bar_stop(ap);
- }
+ }
}
if (mf_progress_bar_timer != NULL) {
ecore_timer_del(mf_progress_bar_timer);
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
}
if (ap->mf_MainWindow.pPopupBox) {
- SAFE_FREE_OBJ(ap->mf_MainWindow.pPopupBox);
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pPopupBox);
}
if (ap->mf_MainWindow.pDeleteConfirmPopup) {
SAFE_FREE_OBJ(ap->mf_MainWindow.pDeleteConfirmPopup);
eext_entry_selection_back_event_allow_set(en, EINA_TRUE);
elm_entry_scrollable_set(en, EINA_TRUE);
elm_scroller_policy_set(en, ELM_SCROLLER_POLICY_OFF,
- ELM_SCROLLER_POLICY_AUTO);
+ ELM_SCROLLER_POLICY_AUTO);
elm_object_signal_emit(en, "elm,action,hide,search_icon", "");
elm_object_part_text_set(en, "elm.guide", "");
elm_entry_single_line_set(en, EINA_TRUE);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_entry_prediction_allow_set(en, EINA_FALSE);
evas_object_show(en);
elm_object_signal_emit(en, "elm,action,hide,search_icon", "");
Evas_Object *btn1 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- LABEL_CANCEL,
- NULL,
- (Evas_Smart_Cb)rename_cancel_cb,
- rename_cancel_params,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ LABEL_CANCEL,
+ NULL,
+ (Evas_Smart_Cb)rename_cancel_cb,
+ rename_cancel_params,
+ EINA_FALSE);
Evas_Object *btn2 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- LABEL_RENAME,//Change MF_LABEL_DONE to MF_BUTTON_LABEL_OK for fixing(P131029-02752).
- NULL,
- (Evas_Smart_Cb)mf_callback_rename_save_cb,
- rename_save_params,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ LABEL_RENAME,//Change MF_LABEL_DONE to MF_BUTTON_LABEL_OK for fixing(P131029-02752).
+ NULL,
+ (Evas_Smart_Cb)mf_callback_rename_save_cb,
+ rename_save_params,
+ EINA_FALSE);
ok_button = btn2;
elm_object_part_content_set(popup, "button1", btn1);
popup = elm_popup_add(ap->mf_MainWindow.pMainLayout);
elm_object_signal_emit(popup, "elm,action,center_popup,entry", "");
- Evas_Object *layout = mf_popup_entry_layout_create(popup);
- elm_object_content_set(popup, layout);
+ Evas_Object *layout = mf_popup_entry_layout_create(popup);
+ elm_object_content_set(popup, layout);
Evas_Object *en = NULL;
en = mf_popup_entry_create(layout);
elm_entry_input_panel_return_key_type_set(en, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
Evas_Object *btn1 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- LABEL_CANCEL,
- NULL,
- (Evas_Smart_Cb)__mf_popup_new_folder_cancel_cb,
- ap,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ LABEL_CANCEL,
+ NULL,
+ (Evas_Smart_Cb)__mf_popup_new_folder_cancel_cb,
+ ap,
+ EINA_FALSE);
Evas_Object *btn2 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- MF_LABEL_CREATE,//Change MF_LABEL_DONE to MF_BUTTON_LABEL_OK for fixing(P131029-02752).
- NULL,
- (Evas_Smart_Cb)mf_callback_new_folder_save_cb,
- ap,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ MF_LABEL_CREATE,//Change MF_LABEL_DONE to MF_BUTTON_LABEL_OK for fixing(P131029-02752).
+ NULL,
+ (Evas_Smart_Cb)mf_callback_new_folder_save_cb,
+ ap,
+ EINA_FALSE);
ok_button = btn2;
elm_object_part_content_set(popup, "button1", btn1);
elm_object_part_content_set(popup, "button2", btn2);
mf_object_text_set(popup, context, "title,text");
- elm_object_part_content_set(layout,"elm.swallow.content", en);
+ elm_object_part_content_set(layout, "elm.swallow.content", en);
evas_object_show(popup);
evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, mf_popup_new_folder_del_cb, ap);
}*/
Evas_Object *mf_popup_center_processing(void *data,
- const char *context,
- const char *first_btn_text,
- Evas_Smart_Cb func,
- void *param,
- Eina_Bool flag_backwork)
+ const char *context,
+ const char *first_btn_text,
+ Evas_Smart_Cb func,
+ void *param,
+ Eina_Bool flag_backwork)
{
mf_error("==================================");
Evas_Object *popup;
}
Evas_Object *mf_popup_text(void *data,
- const char *context, Evas_Object_Event_Cb func,
- void *param)
-{
- mf_error("==================================");
- Evas_Object *popup;
- struct appdata *ap;
-
- ap = (struct appdata *) data;
- popup = elm_popup_add(ap->mf_MainWindow.pMainLayout);
-
- Evas_Object *box = elm_box_add(popup);
- elm_box_horizontal_set(box, EINA_TRUE);
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_box_align_set(box, 0.5, 0.5);
- elm_box_padding_set(box, 16, 0);
-
- // [UI] progress icon
- Evas_Object *progressbar = elm_progressbar_add(popup);
- elm_object_style_set(progressbar, "process_large");/* "toolbar_process" or "pending_list" or "list_prosess" */
- //evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
- //evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_progressbar_pulse(progressbar, EINA_TRUE);
- evas_object_show(progressbar);
- elm_box_pack_end(box, progressbar);
-
- // [UI] text
- Evas_Object *label = elm_label_add(popup);
- //elm_object_text_set(label, context);/* "Loading..." */
- mf_object_text_set(label, context, NULL);
- evas_object_show(label);
- elm_box_pack_end(box, label);
-
-
- // [UI] add table
- Evas_Object *table = elm_table_add(popup);
- evas_object_show(table);
- elm_table_homogeneous_set(table, EINA_FALSE);
-
- Evas_Object *rect_up;// rect as a padding
- rect_up = evas_object_rectangle_add(evas_object_evas_get(popup));
- evas_object_size_hint_min_set(rect_up, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(20));
-
- Evas_Object *rect_down;// rect as a padding
- rect_down = evas_object_rectangle_add(evas_object_evas_get(popup));
- evas_object_size_hint_min_set(rect_down, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(20));
-
- // box
- elm_table_pack(table, rect_up, 0, 0, 2, 1);// rect as a padding
- elm_table_pack(table, box, 0, 1, 2, 1);
- elm_table_pack(table, rect_down, 0, 2, 2, 1);// rect as a padding
- evas_object_show(box);
- elm_object_content_set(popup, table);
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
+ const char *context, Evas_Object_Event_Cb func,
+ void *param)
+{
+ mf_error("==================================");
+ Evas_Object *popup;
+ struct appdata *ap;
+
+ ap = (struct appdata *) data;
+ popup = elm_popup_add(ap->mf_MainWindow.pMainLayout);
- evas_object_show(popup);
- evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, (Evas_Object_Event_Cb)func, param);
- return popup;
+ Evas_Object *box = elm_box_add(popup);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_align_set(box, 0.5, 0.5);
+ elm_box_padding_set(box, 16, 0);
+
+ // [UI] progress icon
+ Evas_Object *progressbar = elm_progressbar_add(popup);
+ elm_object_style_set(progressbar, "process_large");/* "toolbar_process" or "pending_list" or "list_prosess" */
+ //evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
+ //evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_progressbar_pulse(progressbar, EINA_TRUE);
+ evas_object_show(progressbar);
+ elm_box_pack_end(box, progressbar);
+
+ // [UI] text
+ Evas_Object *label = elm_label_add(popup);
+ //elm_object_text_set(label, context);/* "Loading..." */
+ mf_object_text_set(label, context, NULL);
+ evas_object_show(label);
+ elm_box_pack_end(box, label);
+
+
+ // [UI] add table
+ Evas_Object *table = elm_table_add(popup);
+ evas_object_show(table);
+ elm_table_homogeneous_set(table, EINA_FALSE);
+
+ Evas_Object *rect_up;// rect as a padding
+ rect_up = evas_object_rectangle_add(evas_object_evas_get(popup));
+ evas_object_size_hint_min_set(rect_up, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(20));
+
+ Evas_Object *rect_down;// rect as a padding
+ rect_down = evas_object_rectangle_add(evas_object_evas_get(popup));
+ evas_object_size_hint_min_set(rect_down, ELM_SCALE_SIZE(100), ELM_SCALE_SIZE(20));
+
+ // box
+ elm_table_pack(table, rect_up, 0, 0, 2, 1);// rect as a padding
+ elm_table_pack(table, box, 0, 1, 2, 1);
+ elm_table_pack(table, rect_down, 0, 2, 2, 1);// rect as a padding
+ evas_object_show(box);
+ elm_object_content_set(popup, table);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
+
+ evas_object_show(popup);
+ evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, (Evas_Object_Event_Cb)func, param);
+ return popup;
}
/******************************
//pos = elm_win_rotation_get(mf_get_appdata()->mf_MainWindow.pWindow);
int max_item_num = item_cnt;
- if (max_item_num > ITEM_MAX_COUNT)
+ if (max_item_num > ITEM_MAX_COUNT) {
max_item_num = ITEM_MAX_COUNT;
+ }
evas_object_size_hint_min_set(box, -1,
- ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(max_item_num)));
+ ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(max_item_num)));
evas_object_show(content);
elm_box_pack_end(box, content);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
int max_item_num = item_cnt;
- if (max_item_num > ITEM_MAX_COUNT)
+ if (max_item_num > ITEM_MAX_COUNT) {
max_item_num = ITEM_MAX_COUNT;
+ }
evas_object_size_hint_min_set(box, ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_WIDTH),
- ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(max_item_num)));
+ ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(max_item_num)));
evas_object_show(content);
elm_box_pack_end(box, content);
void
mf_elm_popup_item_append(Evas_Object *obj,
- const char *label,
- Evas_Object *icon,
- Evas_Smart_Cb func,
- const void *data)
+ const char *label,
+ Evas_Object *icon,
+ Evas_Smart_Cb func,
+ const void *data)
{
struct appdata * ap = (struct appdata *) mf_get_appdata();
Elm_Object_Item *it = NULL;
item_data->ap = ap;
item_data->title = g_strdup(label);
it = elm_genlist_item_append(obj, ap->mf_gl_style.popup_itc, (void *)item_data, NULL,
- ELM_GENLIST_ITEM_NONE, func, data);
+ ELM_GENLIST_ITEM_NONE, func, data);
item_data->item = it;
if (ap->mf_Status.more == MORE_SEARCH) {
{
- if (item_data->file_type == FILE_TYPE_DIR) {
- //1 Delete
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
+ if (item_data->file_type == FILE_TYPE_DIR) {
+ //1 Delete
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
- //1 Rename
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
+ //1 Rename
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
- //1 Move
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
+ //1 Move
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
- //1 Copy
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
+ //1 Copy
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
- //1 Details
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
- }else {
- //1 Go to folder
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_goto_folder);
+ //1 Details
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
+ } else {
+ //1 Go to folder
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_goto_folder);
- //1 Share
- {
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_share);
- }
+ //1 Share
+ {
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_share);
+ }
- //1 Delete
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
+ //1 Delete
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
- //1 Rename
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
+ //1 Rename
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
- //1 Move
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
+ //1 Move
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
- //1 Copy
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
+ //1 Copy
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
- //1 Details
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
- }
+ //1 Details
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
+ }
}
} else if (ap->mf_Status.view_type == mf_view_root) {
switch (type) {
}
} else {
- if (item_data->file_type == FILE_TYPE_DIR) {
+ if (item_data->file_type == FILE_TYPE_DIR) {
- //1 Delete
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
+ //1 Delete
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
- //1 Rename
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
+ //1 Rename
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
- //1 Move
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
+ //1 Move
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
- //1 Copy
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
+ //1 Copy
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
- //1 Compress
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_compress);
+ //1 Compress
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_compress);
- //1 Details
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
- } else {
- //1 Share
- {
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_share);
- }
+ //1 Details
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
+ } else {
+ //1 Share
+ {
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_share);
+ }
- //1 Delete
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
+ //1 Delete
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_delete);
- //1 Rename
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
+ //1 Rename
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_rename);
- //1 Move
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
+ //1 Move
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_move);
- //1 Copy
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
+ //1 Copy
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_copy);
- //1 Details
- __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
- }
+ //1 Details
+ __mf_popup_operation_item_create(genlist, data, mf_operation_item_details);
+ }
}
MF_TRACE_END;
}
elm_radio_value_set(radio, ap->mf_Status.iRadioValue);
/* elm_object_signal_callback_add(radio, "elm,action,show,finished", "elm", */
- /* __gl_popup_viewby_radio_cb, params); */
+ /* __gl_popup_viewby_radio_cb, params); */
evas_object_show(radio);
return radio;
char *title = NULL;
if (item_data->list_type == mf_list_normal
- || item_data->list_type == mf_list_recent_files) {
+ || item_data->list_type == mf_list_recent_files) {
if (item_data->storage_type == MYFILE_PHONE
- || item_data->storage_type == MYFILE_MMC
- ) {
+ || item_data->storage_type == MYFILE_MMC
+ ) {
if (!mf_file_exists(((mfItemData_s *)item_data)->m_ItemName->str)) {
mf_popup_indicator_popup(NULL, mf_util_get_text(MF_LABEL_FILE_NOT_EXIST));
elm_object_item_del(item_data->item);
return NULL;
}
- elm_object_style_set(popup,"indicator_norepeatevent");
+ elm_object_style_set(popup, "indicator_norepeatevent");
elm_object_focus_set(popup, EINA_FALSE);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
if (title) {
- mf_object_text_set(popup, title, "title,text");//Fixed P140321-05456 by jian12.li
- /*char *temp_utf8 = elm_entry_utf8_to_markup(title);
- if (temp_utf8) {
- elm_object_part_text_set(popup, "title,text", temp_utf8);
- free(temp_utf8);
- }*/
- SAFE_FREE_CHAR(title);
+ mf_object_text_set(popup, title, "title,text");//Fixed P140321-05456 by jian12.li
+ /*char *temp_utf8 = elm_entry_utf8_to_markup(title);
+ if (temp_utf8) {
+ elm_object_part_text_set(popup, "title,text", temp_utf8);
+ free(temp_utf8);
+ }*/
+ SAFE_FREE_CHAR(title);
}
//elm_object_style_set(popup,"content_no_vhpad");
return popup;
}
#endif
-Evas_Object *mf_popup_share_as_video_or_image(void *func_for_video,void *func_for_image, void *data)
+Evas_Object *mf_popup_share_as_video_or_image(void *func_for_video, void *func_for_image, void *data)
{
MF_TRACE_BEGIN
mfItemData_s *item_data = (mfItemData_s *)data;
Evas_Object *popup = NULL;
popup = elm_popup_add(ap->mf_MainWindow.pWindow);
mf_retvm_if(popup == NULL, NULL, "popup is NULL");
- elm_object_style_set(popup,"indicator_norepeatevent");
+ elm_object_style_set(popup, "indicator_norepeatevent");
elm_object_focus_set(popup, EINA_FALSE);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_part_text_set(popup, "title,text", mf_util_get_text(MF_LABEL_SHARE_SOUND_AND_SHOT_PICS));
- elm_popup_item_append(popup,mf_util_get_text(MF_LABEL_SHARE_AS_VIDEO_FILES), NULL, func_for_video, data);
- elm_popup_item_append(popup,mf_util_get_text(MF_LABEL_SHARE_AS_IMAGE_FILES) , NULL, func_for_image, data);
+ elm_popup_item_append(popup, mf_util_get_text(MF_LABEL_SHARE_AS_VIDEO_FILES), NULL, func_for_video, data);
+ elm_popup_item_append(popup, mf_util_get_text(MF_LABEL_SHARE_AS_IMAGE_FILES) , NULL, func_for_image, data);
evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, (Evas_Object_Event_Cb)__mf_popup_longpress_del_cb, ap);
evas_object_smart_callback_add(popup, "block,clicked", (Evas_Smart_Cb)__mf_popup_block_clicked_cb, NULL);
eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
}*/
Evas_Object *mf_popup_create_popup(void *data, ePopMode popupMode, char *title, const char *context, const char *first_btn_text, const char *second_btn_text,
- const char *third_btn_text, Evas_Smart_Cb func, void *param)
+ const char *third_btn_text, Evas_Smart_Cb func, void *param)
{
MF_TRACE_BEGIN;
Evas_Object *popup = NULL;
Evas_Object *btn1 = NULL;
Evas_Object *btn2 = NULL;
int index = 0;
- int listby_selected= 0;
+ int listby_selected = 0;
ap = (struct appdata *)data;
mf_retvm_if(ap == NULL, NULL, "ap is NULL");
elm_popup_timeout_set(popup, 3);
if (func != NULL) {
evas_object_smart_callback_add(popup, "timeout", (Evas_Smart_Cb)func, param);
- }else{
+ } else {
evas_object_smart_callback_add(popup, "timeout", (Evas_Smart_Cb)mf_popup_del_by_timeout, ap);
}
break;
case POPMODE_TEXT_TWO_BTN:
case POPMODE_TITLE_TEXT_TWO_BTN:
btn1 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- first_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ first_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
btn2 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- second_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ second_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_part_content_set(popup, "button1", btn1);
elm_object_part_content_set(popup, "button2", btn2);
break;
case POPMODE_TEXT_BTN:
case POPMODE_TITLE_TEXT_BTN:
btn1 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- first_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ first_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_focus_set(btn1, EINA_TRUE);
elm_object_part_content_set(popup, "button1", btn1);
break;
for (index = 0; index < 2; index++) {
Elm_Object_Item *it = NULL;
ListByData_s *item_data = calloc(sizeof(ListByData_s), sizeof(char));
- if (item_data == NULL)
+ if (item_data == NULL) {
continue;
+ }
memset(item_data, 0x00, sizeof(ListByData_s));
item_data->index = index;
item_data->ap = ap;
it = elm_genlist_item_append(genlist, ap->mf_gl_style.listby_itc, (void *)item_data, NULL,
- ELM_GENLIST_ITEM_NONE, __mf_popup_view_as_genlist_select, popup);
+ ELM_GENLIST_ITEM_NONE, __mf_popup_view_as_genlist_select, popup);
item_data->item = it;
evas_object_smart_callback_add(genlist, "language,changed", mf_genlist_gl_lang_changed, item_data);
}
}
btn1 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- first_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ first_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
btn2 = mf_object_create_button(popup,
- NULL, //"popup_button/default",
- second_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ second_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_part_content_set(popup, "button1", btn1);
elm_object_part_content_set(popup, "button2", btn2);
evas_object_show(popup);
}
btn1 = mf_object_create_button(second_popup,
- NULL, //"popup_button/default",
- btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_part_content_set(second_popup, "button1", btn1);
evas_object_show(second_popup);
evas_object_event_callback_add(second_popup, EVAS_CALLBACK_DEL, __mf_popup_second_popup_del_cb, ap);
}
btn1 = mf_object_create_button(second_popup,
- NULL, //"popup_button/default",
- btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ NULL, //"popup_button/default",
+ btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_focus_set(btn1, EINA_TRUE);
elm_object_part_content_set(second_popup, "button1", btn1);
evas_object_show(second_popup);
mf_retm_if(text == NULL, "text is NULL");
char *notification = mf_util_get_text(text);
int ret = notification_status_message_post(notification);
- if (notification != NULL)
+ if (notification != NULL) {
mf_debug("indicator popup message : %s", notification);
+ }
mf_debug("notification_status_message_post()... [0x%x]!", ret);
if (ret != 0) {
Eina_Bool state = elm_check_state_get(obj);
if (state) {
elm_object_signal_emit(obj, "elm,activate,check,off", "elm");
- }
- else {
+ } else {
elm_object_signal_emit(obj, "elm,activate,check,on", "elm");
}
}
Evas_Object *mf_popup_check_view_popup(void *data,
- const char *title,
- const char *text,
- const char *check_text,
- const char *first_btn_text,
- const char *second_btn_text,
- Evas_Smart_Cb func,
- void *param)
+ const char *title,
+ const char *text,
+ const char *check_text,
+ const char *first_btn_text,
+ const char *second_btn_text,
+ Evas_Smart_Cb func,
+ void *param)
{
Evas_Object *popup;
Evas_Object *layout;
eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
if (title) {
- mf_object_text_set(popup, title, "title,text");
+ mf_object_text_set(popup, title, "title,text");
}
/* layout */
layout = elm_layout_add(popup);
evas_object_show(popup);
if (first_btn_text && func) {
btn1 = mf_object_create_button(popup,
- "popup_button/default",
- first_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ "popup_button/default",
+ first_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_part_content_set(popup, "button1", btn1);
}
if (second_btn_text && func) {
btn2 = mf_object_create_button(popup,
- "popup_button/default",
- second_btn_text,
- NULL,
- (Evas_Smart_Cb)func,
- param,
- EINA_FALSE);
+ "popup_button/default",
+ second_btn_text,
+ NULL,
+ (Evas_Smart_Cb)func,
+ param,
+ EINA_FALSE);
elm_object_part_content_set(popup, "button2", btn2);
}
evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __mf_popup_normal_del_cb, ap);
void
__mf_popup_view_as_genlist_change(ListByData_s *params)
{
- if (params == NULL)
+ if (params == NULL) {
return;
+ }
elm_radio_value_set(params->ap->mf_Status.pRadioGroup, params->index);
int iViewAsType = __mf_popup_get_view_as_type(params->index);
//evas_object_propagate_events_set(radio, EINA_FALSE);
elm_object_signal_emit(radio, "elm,event,pass,enabled", "elm");
evas_object_size_hint_align_set(radio,
- EVAS_HINT_FILL, EVAS_HINT_FILL);
+ EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(radio,
- EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_layout_content_set(layout, "elm.swallow.content", radio);
evas_object_show(radio);
struct appdata *ap = mf_get_appdata();
if (elm_check_state_get(obj)) {
- ap->mf_Status.check=1;
+ ap->mf_Status.check = 1;
} else {
- ap->mf_Status.check=0;
+ ap->mf_Status.check = 0;
}
MF_TRACE_END;
Evas_Object *popup = elm_popup_add(ap->mf_MainWindow.pWindow);
mf_retvm_if(popup == NULL, NULL, "POPUP is NULL");
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- ap->mf_Status.check=0;
+ ap->mf_Status.check = 0;
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
mf_object_text_set(popup, title, "title,text");
/* layout */
Evas_Object *btn2 = NULL;
Evas_Object *btn3 = NULL;
btn1 = mf_object_create_button(popup,
- NULL,
- MF_POPUP_BUTTON_CANCEL,
- NULL,
- (Evas_Smart_Cb)func1,
- ap,
- EINA_FALSE);
+ NULL,
+ MF_POPUP_BUTTON_CANCEL,
+ NULL,
+ (Evas_Smart_Cb)func1,
+ ap,
+ EINA_FALSE);
btn2 = mf_object_create_button(popup,
- NULL,
- MF_LABEL_REPLACE,
- NULL,
- (Evas_Smart_Cb)func2,
- param,
- EINA_FALSE);
+ NULL,
+ MF_LABEL_REPLACE,
+ NULL,
+ (Evas_Smart_Cb)func2,
+ param,
+ EINA_FALSE);
btn3 = mf_object_create_button(popup,
- NULL,
- LABEL_RENAME,
- NULL,
- (Evas_Smart_Cb)func3,
- param,
- EINA_FALSE);
+ NULL,
+ LABEL_RENAME,
+ NULL,
+ (Evas_Smart_Cb)func3,
+ param,
+ EINA_FALSE);
elm_object_part_content_set(popup, "button1", btn1);
elm_object_part_content_set(popup, "button2", btn2);
elm_object_part_content_set(popup, "button3", btn3);
//Elm_Object_Item *it = NULL;
for (index = 0; index < 4; index++) {
elm_genlist_item_append(genlist, ap->mf_gl_style.listby_itc, (void *)index, NULL,
- ELM_GENLIST_ITEM_NONE, __mf_sort_by_gl_select, (void *)index);
+ ELM_GENLIST_ITEM_NONE, __mf_sort_by_gl_select, (void *)index);
}
elm_genlist_item_append(genlist, ap->mf_gl_style.order_itc, NULL, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
for (index = 4; index < 6; index++) {
elm_genlist_item_append(genlist, ap->mf_gl_style.listby_itc, (void *)index, NULL,
- ELM_GENLIST_ITEM_NONE, __mf_sort_by_gl_select, (void *)index);
+ ELM_GENLIST_ITEM_NONE, __mf_sort_by_gl_select, (void *)index);
}
box = __mf_popup_sort_by_box_set(popup, genlist, 6);
ap->mf_MainWindow.pPopupBox = box;
Evas_Object *btn1 = NULL;
Evas_Object *btn2 = NULL;
btn1 = mf_object_create_button(popup,
- "popup",
- LABEL_CANCEL,
- NULL,
- (Evas_Smart_Cb)__mf_sort_by_button_cb,
- ap,
- EINA_FALSE);
+ "popup",
+ LABEL_CANCEL,
+ NULL,
+ (Evas_Smart_Cb)__mf_sort_by_button_cb,
+ ap,
+ EINA_FALSE);
btn2 = mf_object_create_button(popup,
- "popup",
- MF_BUTTON_LABEL_OK,
- NULL,
- (Evas_Smart_Cb)__mf_sort_by_button_cb,
- ap,
- EINA_FALSE);
+ "popup",
+ MF_BUTTON_LABEL_OK,
+ NULL,
+ (Evas_Smart_Cb)__mf_sort_by_button_cb,
+ ap,
+ EINA_FALSE);
elm_object_part_content_set(popup, "button1", btn1);
elm_object_part_content_set(popup, "button2", btn2);
mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.recent_list), MYFILE_TYPE_FSNODE);
mf_util_generate_saved_files_list(ap, mf_list_recent_files);
- if (eina_list_count(ap->mf_FileOperation.recent_list) == 0)
- {
+ if (eina_list_count(ap->mf_FileOperation.recent_list) == 0) {
mf_debug("No recent lists");
content = mf_object_create_multi_no_content(ap->mf_MainWindow.pNaviLayout);
mf_object_text_set(content, MF_LABEL_NO_FILES, "elm.text");
ap->mf_MainWindow.pNaviGengrid = NULL;
- ap->mf_MainWindow.pNaviGenlist= NULL;
+ ap->mf_MainWindow.pNaviGenlist = NULL;
ap->mf_Status.flagNoContent = EINA_TRUE;
} else {
int iSortTypeValue = 0;
MF_TA_ACUM_ITEM_BEGIN("123456 push naviframe item", 0);
if (ap->mf_Status.pPreNaviItem) {
ap->mf_MainWindow.pNaviItem = elm_naviframe_item_insert_after(ap->mf_MainWindow.pNaviBar,
- ap->mf_Status.pPreNaviItem, "", NULL, NULL, ap->mf_MainWindow.pNaviLayout,
- MF_NAVI_STYLE_ENABLE);
+ ap->mf_Status.pPreNaviItem, "", NULL, NULL, ap->mf_MainWindow.pNaviLayout,
+ MF_NAVI_STYLE_ENABLE);
} else {
ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(ap->mf_MainWindow.pNaviBar, NULL, NULL, NULL,
- ap->mf_MainWindow.pNaviLayout, MF_NAVI_STYLE_ENABLE);
+ ap->mf_MainWindow.pNaviLayout, MF_NAVI_STYLE_ENABLE);
}
MF_TA_ACUM_ITEM_END("123456 push naviframe item", 0);
/*if (first_index_item) {
it = elm_genlist_item_insert_before(genlist, &root_category_itc, ap, NULL, first_index_item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
} else {*/
- it = elm_genlist_item_prepend(genlist, &root_category_itc, ap, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ it = elm_genlist_item_prepend(genlist, &root_category_itc, ap, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
//}
elm_genlist_item_show(it, ELM_GENLIST_ITEM_SCROLLTO_TOP);
MF_TRACE_END;
if (category) {
if (changed_angle == APP_DEVICE_ORIENTATION_90 || changed_angle == APP_DEVICE_ORIENTATION_270) {
- if (box_root_category)
+ if (box_root_category) {
evas_object_size_hint_min_set(box_root_category, ELM_SCALE_SIZE(1280), -1);
+ }
edje_object_signal_emit(_EDJ(category), "landscape", "category_frame");
} else {
- if (box_root_category)
+ if (box_root_category) {
evas_object_size_hint_min_set(box_root_category, ELM_SCALE_SIZE(720), -1);
+ }
edje_object_signal_emit(_EDJ(category), "portrait", "category_frame");
}
}
MF_TRACE_BEGIN;
mf_retvm_if(data == NULL, NULL, "data is NULL");
struct appdata *ap = (struct appdata *)data;
- /*create detail layout*/
+ /*create detail layout*/
Evas_Object *category = mf_category_create(ap);
/*
mf_retm_if(pNode->path == NULL, "pNode->path is NULL");
mf_retm_if(pNode->name == NULL, "pNode->name is NULL");
mf_retm_if(data == NULL, "data is NULL");
-
+
char *real_name = NULL;
mfItemData_s *m_TempItem = NULL;
struct appdata *ap = (struct appdata *)data;
MF_TA_ACUM_ITEM_BEGIN("123456 mf_navi_bar_set_ctrlbar", 0);
mf_navi_bar_set_ctrlbar(data);
MF_TA_ACUM_ITEM_END("123456 mf_navi_bar_set_ctrlbar", 0);
- mf_navi_bar_title_content_set(ap,ap->mf_MainWindow.naviframe_title);
+ mf_navi_bar_title_content_set(ap, ap->mf_MainWindow.naviframe_title);
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_TRUE, EINA_TRUE);
MF_TA_ACUM_ITEM_END("12345 mf_root_view_create", 0);
extern pthread_cond_t gCondSearchMsg;
static Eina_Bool search_all_flag = EINA_FALSE;
static Eina_Bool do_search_all = EINA_FALSE;
-static Ecore_Idler *entry_focus_allow_idler =NULL;
+static Ecore_Idler *entry_focus_allow_idler = NULL;
typedef struct {
char *size;
if (!strcmp(part, "elm.icon")) {
Evas_Object *btn = mf_object_create_button(obj,
- NULL,
- MF_LABEL_SEARCH_ALL,
- NULL,
- __mf_search_bar_sel_search_all,
- data,
- EINA_FALSE);
+ NULL,
+ MF_LABEL_SEARCH_ALL,
+ NULL,
+ __mf_search_bar_sel_search_all,
+ data,
+ EINA_FALSE);
return btn;
}
itc->func.state_get = NULL;
itc->func.del = NULL;
elm_genlist_item_append(ap->mf_MainWindow.pNaviGenlist, itc, ap, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
}
}
}
mf_debug("ret is %d\n", ret);
if (ret) {
ap->mf_MainWindow.pNormalPopup =
- mf_popup_create_popup(ap, POPMODE_TEXT, NULL, MF_LABEL_UNSUPPORT_FILE_TYPE, NULL, NULL, NULL, NULL, NULL);
+ mf_popup_create_popup(ap, POPMODE_TEXT, NULL, MF_LABEL_UNSUPPORT_FILE_TYPE, NULL, NULL, NULL, NULL, NULL);
}
}
MF_TRACE_END;
struct appdata *ap = (struct appdata *)selected->ap;
//fix P131209-00523 by wangyan,search -> longpress searched file-> back, highlight should be released
elm_genlist_item_selected_set(item, FALSE);
- if (ap->mf_MainWindow.pLongpressPopup!=NULL) {
+ if (ap->mf_MainWindow.pLongpressPopup != NULL) {
return;
}
if (ap->mf_Status.more == MORE_EDIT_RENAME) {
mf_callback_rename_save_cb(ap, NULL, NULL);
return;
} else if (ap->mf_Status.more == MORE_EDIT || ap->mf_Status.more == MORE_SHARE_EDIT ||
- ap->mf_Status.more == MORE_EDIT_COPY || ap->mf_Status.more == MORE_EDIT_MOVE ||
- ap->mf_Status.more == MORE_EDIT_DETAIL || ap->mf_Status.more == MORE_EDIT_DELETE
- || ap->mf_Status.more == MORE_SHARE_EDIT) {
+ ap->mf_Status.more == MORE_EDIT_COPY || ap->mf_Status.more == MORE_EDIT_MOVE ||
+ ap->mf_Status.more == MORE_EDIT_DETAIL || ap->mf_Status.more == MORE_EDIT_DELETE
+ || ap->mf_Status.more == MORE_SHARE_EDIT) {
if (selected->file_type == FILE_TYPE_DIR) {
mf_info("select type is DIR");
if (mf_edit_folder_list_item_exists(selected->item)) {
}
}
if (ap->mf_Status.more == MORE_EDIT_COPY || ap->mf_Status.more == MORE_EDIT_MOVE) {
- mf_callback_copy_move_cb(ap,NULL,NULL);
+ mf_callback_copy_move_cb(ap, NULL, NULL);
} else if (ap->mf_Status.more == MORE_EDIT_DELETE) {
- mf_callback_delete_cb(ap,NULL,NULL);
+ mf_callback_delete_cb(ap, NULL, NULL);
} else if (ap->mf_Status.more == MORE_SHARE_EDIT) {
- mf_callback_share_cb(ap,NULL,NULL);
+ mf_callback_share_cb(ap, NULL, NULL);
} else if (ap->mf_Status.more == MORE_EDIT_DETAIL) {
mf_debug("detail callback");
- mf_callback_details_cb(ap,NULL,NULL);
+ mf_callback_details_cb(ap, NULL, NULL);
}
} else {
__mf_search_bar_click_item(selected);
Elm_Object_Item *git = NULL;
git = elm_gengrid_item_append(ap->mf_MainWindow.pNaviGengrid, &search_gic, item_data, __mf_search_bar_grid_item_sel, ap);
item_data->item = git;
- }
- else
- {
+ } else {
Elm_Object_Item *it = NULL;
it = elm_genlist_item_append(ap->mf_MainWindow.pNaviGenlist, ap->mf_gl_style.search_itc, item_data, NULL,
- ELM_GENLIST_ITEM_NONE, __mf_search_bar_item_sel, ap);
+ ELM_GENLIST_ITEM_NONE, __mf_search_bar_item_sel, ap);
item_data->item = it;
}
#else
Elm_Object_Item *it = NULL;
it = elm_genlist_item_append(ap->mf_MainWindow.pNaviGenlist, ap->mf_gl_style.search_itc, m_TempItem, NULL,
- ELM_GENLIST_ITEM_NONE, __mf_search_bar_item_sel, ap);
+ ELM_GENLIST_ITEM_NONE, __mf_search_bar_item_sel, ap);
m_TempItem->item = it;
#endif
}
mf_retm_if(data == NULL, "data is NULL");
mf_retm_if(pLayout == NULL, "pConform is NULL");
mf_retm_if(NaviContent == NULL, "NaviContent is NULL");
-
+
elm_box_clear(pLayout);
elm_box_pack_end(pLayout, NaviContent);
MF_TRACE_END;
Evas_Object *more_bt = NULL;
ap->mf_Status.extra = MORE_SEARCH;
more_bt = mf_object_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_EDIT, MF_LABEL_MORE,
- NULL, (Evas_Smart_Cb)mf_callback_more_button_cb, ap, EINA_FALSE);
+ NULL, (Evas_Smart_Cb)mf_callback_more_button_cb, ap, EINA_FALSE);
if (more_bt) {
Evas_Object *unset = elm_object_item_part_content_unset(navi_it, NAVI_MORE_BUTTON_PART);
if (result->file_list != NULL) {
g_list_foreach(result->file_list, mf_search_bar_file_item_append, ap);
}
- if(ap->mf_Status.count == 0) {
+ if (ap->mf_Status.count == 0) {
ap->mf_Status.flagNoContent = true;
Evas_Object *parent = NULL;
parent = ap->mf_MainWindow.pNaviBar;
if (view_style != MF_VIEW_STYLE_THUMBNAIL) {
elm_genlist_clear(ap->mf_MainWindow.pNaviGenlist);
EINA_LIST_FOREACH(ap->mf_FileOperation.search_result_folder_list, l, item_data) {
- if (item_data && item_data->m_ItemName && item_data->m_ItemName->str) {
- if (!mf_file_exists(item_data->m_ItemName->str)) {
- ap->mf_FileOperation.search_result_folder_list = eina_list_remove(ap->mf_FileOperation.search_result_folder_list, item_data);
- mf_util_normal_item_data_free(&item_data);
- continue;
- }
- if (ap->mf_Status.search_category == mf_tray_item_category_none) {
- __mf_search_bar_item_append(ap, item_data);
- }
- }
- }
- EINA_LIST_FOREACH(ap->mf_FileOperation.search_result_file_list, l, item_data) {
- if (item_data) {
- if (!mf_file_exists(item_data->m_ItemName->str)) {
- ap->mf_FileOperation.search_result_file_list = eina_list_remove(ap->mf_FileOperation.search_result_file_list, item_data);
- mf_util_normal_item_data_free(&item_data);
- continue;
- }
- if (ap->mf_Status.search_category != mf_tray_item_category_none) {
- int type = 0;
- type = mf_tray_item_category_type_get_by_file_type(item_data->file_type);
- if (type != ap->mf_Status.search_category) {
- continue;
- } else {
- __mf_search_bar_item_append(ap, item_data);
- }
- } else {
- __mf_search_bar_item_append(ap, item_data);
- }
- }
- }
+ if (item_data && item_data->m_ItemName && item_data->m_ItemName->str) {
+ if (!mf_file_exists(item_data->m_ItemName->str)) {
+ ap->mf_FileOperation.search_result_folder_list = eina_list_remove(ap->mf_FileOperation.search_result_folder_list, item_data);
+ mf_util_normal_item_data_free(&item_data);
+ continue;
+ }
+ if (ap->mf_Status.search_category == mf_tray_item_category_none) {
+ __mf_search_bar_item_append(ap, item_data);
+ }
+ }
+ }
+ EINA_LIST_FOREACH(ap->mf_FileOperation.search_result_file_list, l, item_data) {
+ if (item_data) {
+ if (!mf_file_exists(item_data->m_ItemName->str)) {
+ ap->mf_FileOperation.search_result_file_list = eina_list_remove(ap->mf_FileOperation.search_result_file_list, item_data);
+ mf_util_normal_item_data_free(&item_data);
+ continue;
+ }
+ if (ap->mf_Status.search_category != mf_tray_item_category_none) {
+ int type = 0;
+ type = mf_tray_item_category_type_get_by_file_type(item_data->file_type);
+ if (type != ap->mf_Status.search_category) {
+ continue;
+ } else {
+ __mf_search_bar_item_append(ap, item_data);
+ }
+ } else {
+ __mf_search_bar_item_append(ap, item_data);
+ }
+ }
+ }
if (elm_genlist_items_count(ap->mf_MainWindow.pNaviGenlist) == 0) {
//Evas_Object *no_content = NULL;
} else {
elm_gengrid_clear(ap->mf_MainWindow.pNaviGengrid);
EINA_LIST_FOREACH(ap->mf_FileOperation.search_result_folder_list, l, item_data) {
- if (item_data) {
- if (!mf_file_exists(item_data->m_ItemName->str)) {
- ap->mf_FileOperation.search_result_folder_list = eina_list_remove(ap->mf_FileOperation.search_result_folder_list, item_data);
- mf_util_normal_item_data_free(&item_data);
- continue;
- }
- if (ap->mf_Status.search_category == mf_tray_item_category_none) {
- __mf_search_bar_item_append(ap, item_data);
- }
- }
- }
- EINA_LIST_FOREACH(ap->mf_FileOperation.search_result_file_list, l, item_data) {
- if (item_data && item_data->m_ItemName && item_data->m_ItemName->str) {
- if (!mf_file_exists(item_data->m_ItemName->str)) {
- ap->mf_FileOperation.search_result_file_list = eina_list_remove(ap->mf_FileOperation.search_result_file_list, item_data);
- mf_util_normal_item_data_free(&item_data);
- continue;
- }
- if (ap->mf_Status.search_category != mf_tray_item_category_none) {
- int type = 0;
- type = mf_tray_item_category_type_get_by_file_type(item_data->file_type);
- if (type != ap->mf_Status.search_category) {
- continue;
- } else {
- __mf_search_bar_item_append(ap, item_data);
- }
- } else {
- __mf_search_bar_item_append(ap, item_data);
- }
- }
- }
- if (elm_gengrid_items_count(ap->mf_MainWindow.pNaviGengrid) == 0) {
- Evas_Object *parent = NULL;
- parent = ap->mf_MainWindow.pNaviLayout;
- Evas_Object *no_content = elm_layout_add(parent);
- elm_layout_theme_set(no_content, "layout", "nocontents", "search");
- elm_object_focus_set(no_content, EINA_FALSE);
- evas_object_size_hint_weight_set(no_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(no_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
- //mf_object_disable_virtualkeypad();
- mf_object_text_set(no_content, MF_LABEL_NO_RESULT_FOUND, "elm.text");
- mf_search_bar_set_content(ap, ap->mf_MainWindow.pNaviBox, no_content,true);
- evas_object_show(no_content);
- ap->mf_MainWindow.pNaviGengrid = NULL;
+ if (item_data) {
+ if (!mf_file_exists(item_data->m_ItemName->str)) {
+ ap->mf_FileOperation.search_result_folder_list = eina_list_remove(ap->mf_FileOperation.search_result_folder_list, item_data);
+ mf_util_normal_item_data_free(&item_data);
+ continue;
+ }
+ if (ap->mf_Status.search_category == mf_tray_item_category_none) {
+ __mf_search_bar_item_append(ap, item_data);
+ }
+ }
+ }
+ EINA_LIST_FOREACH(ap->mf_FileOperation.search_result_file_list, l, item_data) {
+ if (item_data && item_data->m_ItemName && item_data->m_ItemName->str) {
+ if (!mf_file_exists(item_data->m_ItemName->str)) {
+ ap->mf_FileOperation.search_result_file_list = eina_list_remove(ap->mf_FileOperation.search_result_file_list, item_data);
+ mf_util_normal_item_data_free(&item_data);
+ continue;
+ }
+ if (ap->mf_Status.search_category != mf_tray_item_category_none) {
+ int type = 0;
+ type = mf_tray_item_category_type_get_by_file_type(item_data->file_type);
+ if (type != ap->mf_Status.search_category) {
+ continue;
+ } else {
+ __mf_search_bar_item_append(ap, item_data);
+ }
+ } else {
+ __mf_search_bar_item_append(ap, item_data);
+ }
+ }
+ }
+ if (elm_gengrid_items_count(ap->mf_MainWindow.pNaviGengrid) == 0) {
+ Evas_Object *parent = NULL;
+ parent = ap->mf_MainWindow.pNaviLayout;
+ Evas_Object *no_content = elm_layout_add(parent);
+ elm_layout_theme_set(no_content, "layout", "nocontents", "search");
+ elm_object_focus_set(no_content, EINA_FALSE);
+ evas_object_size_hint_weight_set(no_content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(no_content, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ //mf_object_disable_virtualkeypad();
+ mf_object_text_set(no_content, MF_LABEL_NO_RESULT_FOUND, "elm.text");
+ mf_search_bar_set_content(ap, ap->mf_MainWindow.pNaviBox, no_content, true);
+ evas_object_show(no_content);
+ ap->mf_MainWindow.pNaviGengrid = NULL;
}
}
}
#endif
Evas_Object *progressbar = elm_progressbar_add(ap->mf_MainWindow.pNaviBar);
- elm_object_style_set(progressbar, "list_process");
- evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
- evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_show(progressbar);
- elm_progressbar_pulse(progressbar, EINA_TRUE);
+ elm_object_style_set(progressbar, "list_process");
+ evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
+ evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(progressbar);
+ elm_progressbar_pulse(progressbar, EINA_TRUE);
elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, TITLE_RIGHT_BTN, progressbar);
}
if (msg_type == MF_SEARCH_PIPE_MSG_DOING) {
} else {
mf_search_bar_content_create(result, ap);
}
- }else {
+ } else {
mf_search_bar_content_create(result, ap);
}
}
//mf_object_disable_virtualkeypad();
mf_object_text_set(no_content, MF_LABEL_NO_RESULT_FOUND, "elm.text");
evas_object_show(no_content);
- mf_search_bar_set_content(ap, ap->mf_MainWindow.pNaviBox, no_content,true);
+ mf_search_bar_set_content(ap, ap->mf_MainWindow.pNaviBox, no_content, true);
//mf_navi_bar_layout_content_set(parent, pSearchBarLabel);
}
//mf_object_disable_virtualkeypad();
mf_object_text_set(no_content, MF_LABEL_NO_RESULT_FOUND, "elm.text");
evas_object_show(no_content);
- mf_search_bar_set_content(ap, ap->mf_MainWindow.pNaviBox, no_content,true);
+ mf_search_bar_set_content(ap, ap->mf_MainWindow.pNaviBox, no_content, true);
//mf_navi_bar_layout_content_set(parent, pSearchBarLabel);
} else {
}
if (ap->mf_Status.view_type == mf_view_root
- || ap->mf_Status.view_type == mf_view_root_category
- || ap->mf_Status.view_type == mf_view_storage
- || ap->mf_Status.view_type == mf_view_recent) {
+ || ap->mf_Status.view_type == mf_view_root_category
+ || ap->mf_Status.view_type == mf_view_storage
+ || ap->mf_Status.view_type == mf_view_recent) {
SearchRoot[0] = PHONE_FOLDER;
root_num++;
if (ap->mf_Status.iStorageState & MYFILE_MMC) {
root_num++;
}
do_search_all = EINA_FALSE;
- }
- else {
+ } else {
SearchRoot[0] = ap->mf_Status.path->str;
root_num++;
}
char *new_desc = NULL;
/*Start Search routine*/
if (!mf_search_start(ap->mf_Status.search_handler, SearchRoot, root_num, \
- ((text) ? text : NULL), MF_SEARCH_OPTION_DEF, (void *)ap, NULL, mf_tray_item_category_none, MF_CATEGOR_SEARCH_ITEM_COUNT)) {
+ ((text) ? text : NULL), MF_SEARCH_OPTION_DEF, (void *)ap, NULL, mf_tray_item_category_none, MF_CATEGOR_SEARCH_ITEM_COUNT)) {
/*generate the popup used to show search path
**it's sure that new_desc is not NULL even if original path is NULL*/
new_desc = mf_fm_svc_wrapper_translate_path(ap->mf_Status.path->str, MF_TRANS_OPTION_POPUP);
return;
}
- if (ap->mf_Status.search_handler > 0)
+ if (ap->mf_Status.search_handler > 0) {
mf_search_finalize(&ap->mf_Status.search_handler);
+ }
int ret = mf_search_init(&ap->mf_Status.search_handler);
mf_retm_if(ret < 0, "Fail to mf_search_init()");
//mf_navi_bar_title_content_set(ap, LABEL_MYFILE);
}
//
-
+
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_FALSE, EINA_FALSE);
evas_object_show(ap->mf_MainWindow.pSearchEntry);
Evas_Object *scroller = elm_scroller_add(parent);
elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
- elm_scroller_policy_set(scroller,ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
evas_object_show(scroller);
elm_object_style_set(scroller, "dialogue");
Evas_Object *content = elm_layout_add(extension);
elm_layout_theme_set(content, "layout",
- "list/C/type.2", "default");
-
+ "list/C/type.2", "default");
+
check_extension = elm_check_add(extension);
//evas_object_resize(check_extension, -1, 46);
evas_object_propagate_events_set(check_extension, EINA_FALSE);
content = elm_layout_add(extension);
elm_layout_theme_set(content, "layout",
- "list/C/type.2", "default");
+ "list/C/type.2", "default");
check_hiden = elm_check_add(hiden);
//evas_object_resize(check_hiden, -1, 46);
void update_lang(void)
{
- char *lang = NULL;
- char *baselang = NULL;
- char *r = NULL;
+ char *lang = NULL;
+ char *baselang = NULL;
+ char *r = NULL;
int retcode = -1;
retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- mf_error("[ERR] failed to get the language");
+ mf_error("[ERR] failed to get the language");
+ }
+ if (lang) {
+ setenv("LANG", lang, 1);
+ setenv("LC_MESSAGES", lang, 1);
+ r = setlocale(LC_ALL, "");
+ if (r == NULL) {
+ retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &baselang);
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
+ mf_error("[ERR] failed to get the language");
+ }
+ if (baselang) {
+ setlocale(LC_ALL, baselang);
+ free(baselang);
+ }
+ }
+ free(lang);
}
- if (lang) {
- setenv("LANG", lang, 1);
- setenv("LC_MESSAGES", lang, 1);
- r = setlocale(LC_ALL, "");
- if (r == NULL) {
- retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &baselang);
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- mf_error("[ERR] failed to get the language");
- }
- if (baselang) {
- setlocale(LC_ALL, baselang);
- free(baselang);
- }
- }
- free(lang);
- }
}
void update_region(void)
{
- char *region = NULL;
- int retcode = -1;
- retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion);
+ char *region = NULL;
+ int retcode = -1;
+ retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, ®ion);
if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- mf_error("[ERR] failed to get the region");
+ mf_error("[ERR] failed to get the region");
+ }
+ if (region) {
+ setenv("LC_CTYPE", region, 1);
+ setenv("LC_NUMERIC", region, 1);
+ setenv("LC_TIME", region, 1);
+ setenv("LC_COLLATE", region, 1);
+ setenv("LC_MONETARY", region, 1);
+ setenv("LC_PAPER", region, 1);
+ setenv("LC_NAME", region, 1);
+ setenv("LC_ADDRESS", region, 1);
+ setenv("LC_TELEPHONE", region, 1);
+ setenv("LC_MEASUREMENT", region, 1);
+ setenv("LC_IDENTIFICATION", region, 1);
+ free(region);
}
- if (region) {
- setenv("LC_CTYPE", region, 1);
- setenv("LC_NUMERIC", region, 1);
- setenv("LC_TIME", region, 1);
- setenv("LC_COLLATE", region, 1);
- setenv("LC_MONETARY", region, 1);
- setenv("LC_PAPER", region, 1);
- setenv("LC_NAME", region, 1);
- setenv("LC_ADDRESS", region, 1);
- setenv("LC_TELEPHONE", region, 1);
- setenv("LC_MEASUREMENT", region, 1);
- setenv("LC_IDENTIFICATION", region, 1);
- free(region);
- }
}
static int __set_i18n(const char *domain, const char *dir)
r = setlocale(LC_ALL, "");
/* if locale is not set properly, try again to set as language base */
if (r == NULL) {
- char *lang = NULL;
- int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
- if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
- mf_error("[ERR] failed to get the language");
- }
- if (lang) {
- setlocale(LC_ALL, lang);
- free(lang);
- }
+ char *lang = NULL;
+ int retcode = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
+ if (retcode != SYSTEM_SETTINGS_ERROR_NONE) {
+ mf_error("[ERR] failed to get the language");
+ }
+ if (lang) {
+ setlocale(LC_ALL, lang);
+ free(lang);
+ }
}
bindtextdomain(domain, dir);
textdomain(domain);
int mf_setting_set_i18n(char *pkgname, char *localedir)
{
mf_error("===============================");
- //update_lang();
- // update_region();
+ //update_lang();
+ // update_region();
- return __set_i18n(pkgname, localedir);
+ return __set_i18n(pkgname, localedir);
}
#define MF_CATEGORY_LAYOUT_EDJ EDJ_PATH"/myfile_category.edj"
#define MF_CATEGORY_LAYOUT_GROUP "category_frame"
-typedef struct __mf_category_layout
-{
+typedef struct __mf_category_layout {
Evas_Object *category_text;
Evas_Object *category_frame;
Evas_Object *category_image;
ap->mf_Status.categorytitle = name ;
if (ap->mf_MainWindow.pNaviGengrid == NULL) {
- ap->mf_MainWindow.pNaviGengrid = mf_gengrid_create(ap->mf_MainWindow.pNaviBar,ap);
+ ap->mf_MainWindow.pNaviGengrid = mf_gengrid_create(ap->mf_MainWindow.pNaviBar, ap);
}
ap->mf_Status.category_type = type;
mf_category_view_create(ap, false);
void mf_category_item_title_refresh(Evas_Object *parent)
{
MF_TRACE_BEGIN;
- if (g_mf_category_layout.category_image)
- elm_object_part_text_set((g_mf_category_layout.category_image),"category_image_title",mf_util_get_text(MF_LABEL_IMAGES));
- if (g_mf_category_layout.category_video)
- elm_object_part_text_set((g_mf_category_layout.category_video),"category_video_title",mf_util_get_text(MF_LABEL_VIDEOS));
- if (g_mf_category_layout.category_sound)
- elm_object_part_text_set((g_mf_category_layout.category_sound),"category_sound_title",mf_util_get_text(MF_LABEL_TITLE_AUDIOS));
- if (g_mf_category_layout.category_document)
- elm_object_part_text_set((g_mf_category_layout.category_document),"category_document_title",mf_util_get_text(MF_LABLE_SHORTCUT_DOCUMENTS));
- if (g_mf_category_layout.category_text)
- elm_object_part_text_set((g_mf_category_layout.category_text),"category_text_title", mf_util_get_text(MF_LABEL_CATEGORY));
+ if (g_mf_category_layout.category_image) {
+ elm_object_part_text_set((g_mf_category_layout.category_image), "category_image_title", mf_util_get_text(MF_LABEL_IMAGES));
+ }
+ if (g_mf_category_layout.category_video) {
+ elm_object_part_text_set((g_mf_category_layout.category_video), "category_video_title", mf_util_get_text(MF_LABEL_VIDEOS));
+ }
+ if (g_mf_category_layout.category_sound) {
+ elm_object_part_text_set((g_mf_category_layout.category_sound), "category_sound_title", mf_util_get_text(MF_LABEL_TITLE_AUDIOS));
+ }
+ if (g_mf_category_layout.category_document) {
+ elm_object_part_text_set((g_mf_category_layout.category_document), "category_document_title", mf_util_get_text(MF_LABLE_SHORTCUT_DOCUMENTS));
+ }
+ if (g_mf_category_layout.category_text) {
+ elm_object_part_text_set((g_mf_category_layout.category_text), "category_text_title", mf_util_get_text(MF_LABEL_CATEGORY));
+ }
if (g_mf_category_layout.category_recent) {
- elm_object_part_text_set((g_mf_category_layout.category_recent),"category_recent_title",mf_util_get_text(MF_LABEL_RECTENT_FILES));
- elm_object_part_text_set((g_mf_category_layout.category_recent),"category_recent_size","0.0 Byte");
+ elm_object_part_text_set((g_mf_category_layout.category_recent), "category_recent_title", mf_util_get_text(MF_LABEL_RECTENT_FILES));
+ elm_object_part_text_set((g_mf_category_layout.category_recent), "category_recent_size", "0.0 Byte");
}
}
{
MF_TRACE_BEGIN;
switch (category) {
- case mf_tray_item_category_none:{
- if (g_mf_category_layout.category_image) {
- elm_object_part_text_set((g_mf_category_layout.category_image),"category_image_size", "");
- }
- if (g_mf_category_layout.category_video) {
- elm_object_part_text_set((g_mf_category_layout.category_video),"category_video_size", "");
- }
- if (g_mf_category_layout.category_sound) {
- elm_object_part_text_set((g_mf_category_layout.category_sound),"category_sound_size", "");
- }
- if (g_mf_category_layout.category_document) {
- elm_object_part_text_set((g_mf_category_layout.category_document),"category_document_size", "");
- }
- if (g_mf_category_layout.category_recent) {
- elm_object_part_text_set((g_mf_category_layout.category_recent),"category_recent_size", "");
- }
- break;
+ case mf_tray_item_category_none: {
+ if (g_mf_category_layout.category_image) {
+ elm_object_part_text_set((g_mf_category_layout.category_image), "category_image_size", "");
}
- case mf_tray_item_category_image:{
- elm_object_part_text_set((g_mf_category_layout.category_image),"category_image_size", "");
- break;
+ if (g_mf_category_layout.category_video) {
+ elm_object_part_text_set((g_mf_category_layout.category_video), "category_video_size", "");
}
- case mf_tray_item_category_video:{
- elm_object_part_text_set((g_mf_category_layout.category_video),"category_video_size", "");
- break;
+ if (g_mf_category_layout.category_sound) {
+ elm_object_part_text_set((g_mf_category_layout.category_sound), "category_sound_size", "");
}
- case mf_tray_item_category_sounds:{
- elm_object_part_text_set((g_mf_category_layout.category_sound),"category_sound_size", "");
- break;
- }
- case mf_tray_item_category_document:{
- elm_object_part_text_set((g_mf_category_layout.category_document),"category_document_size", "");
- break;
+ if (g_mf_category_layout.category_document) {
+ elm_object_part_text_set((g_mf_category_layout.category_document), "category_document_size", "");
}
- case mf_tray_item_category_recent:{
- elm_object_part_text_set((g_mf_category_layout.category_recent),"category_recent_size", "");
- break;
+ if (g_mf_category_layout.category_recent) {
+ elm_object_part_text_set((g_mf_category_layout.category_recent), "category_recent_size", "");
}
- default:
- break;
+ break;
+ }
+ case mf_tray_item_category_image: {
+ elm_object_part_text_set((g_mf_category_layout.category_image), "category_image_size", "");
+ break;
+ }
+ case mf_tray_item_category_video: {
+ elm_object_part_text_set((g_mf_category_layout.category_video), "category_video_size", "");
+ break;
+ }
+ case mf_tray_item_category_sounds: {
+ elm_object_part_text_set((g_mf_category_layout.category_sound), "category_sound_size", "");
+ break;
+ }
+ case mf_tray_item_category_document: {
+ elm_object_part_text_set((g_mf_category_layout.category_document), "category_document_size", "");
+ break;
+ }
+ case mf_tray_item_category_recent: {
+ elm_object_part_text_set((g_mf_category_layout.category_recent), "category_recent_size", "");
+ break;
+ }
+ default:
+ break;
}
}
{
MF_TRACE_BEGIN;
switch (category) {
- case mf_tray_item_category_none:{
- mfStorageStatus* storage_status = (mfStorageStatus*) mf_storage_get_status(pUserData);
- if (g_mf_category_layout.category_image) {
- if (storage_status->image_size_info.total_size >= 0.0) {
- char *size = mf_launch_item_size_calculate((double)storage_status->image_size_info.total_size);
- elm_object_part_text_set((g_mf_category_layout.category_image),"category_image_size", size);
- SAFE_FREE_CHAR(size);
- }
- }
- if (g_mf_category_layout.category_video) {
- if (storage_status->video_size_info.total_size >= 0.0) {
- char *size = mf_launch_item_size_calculate((double)storage_status->video_size_info.total_size);
- elm_object_part_text_set((g_mf_category_layout.category_video),"category_video_size", size);
- SAFE_FREE_CHAR(size);
- }
- }
- if (g_mf_category_layout.category_sound) {
- if (storage_status->sound_size_info.total_size >= 0.0) {
- char *size = mf_launch_item_size_calculate((double)storage_status->sound_size_info.total_size);
- elm_object_part_text_set((g_mf_category_layout.category_sound),"category_sound_size", size);
- SAFE_FREE_CHAR(size);
- }
- }
- if (g_mf_category_layout.category_document) {
- if (storage_status->document_size_info.total_size >= 0.0) {
- char *size = mf_launch_item_size_calculate((double)storage_status->document_size_info.total_size);
- elm_object_part_text_set((g_mf_category_layout.category_document),"category_document_size", size);
- SAFE_FREE_CHAR(size);
- }
- }
- if (g_mf_category_layout.category_recent) {
- if (storage_status->recent_size_info.total_size >= 0.0) {
- char *size = mf_launch_item_size_calculate((double)storage_status->recent_size_info.total_size);
- elm_object_part_text_set((g_mf_category_layout.category_recent),"category_recent_size", size);
- SAFE_FREE_CHAR(size);
- }
- }
- break;
- }
- case mf_tray_item_category_image:{
- if (update_info) {
- char *size = mf_launch_item_size_calculate((double)update_info->total_size);
- elm_object_part_text_set((g_mf_category_layout.category_image),"category_image_size", size);
+ case mf_tray_item_category_none: {
+ mfStorageStatus* storage_status = (mfStorageStatus*) mf_storage_get_status(pUserData);
+ if (g_mf_category_layout.category_image) {
+ if (storage_status->image_size_info.total_size >= 0.0) {
+ char *size = mf_launch_item_size_calculate((double)storage_status->image_size_info.total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_image), "category_image_size", size);
SAFE_FREE_CHAR(size);
}
- break;
}
- case mf_tray_item_category_video:{
- if (update_info) {
- char *size = mf_launch_item_size_calculate((double)update_info->total_size);
- elm_object_part_text_set((g_mf_category_layout.category_video),"category_video_size", size);
+ if (g_mf_category_layout.category_video) {
+ if (storage_status->video_size_info.total_size >= 0.0) {
+ char *size = mf_launch_item_size_calculate((double)storage_status->video_size_info.total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_video), "category_video_size", size);
SAFE_FREE_CHAR(size);
}
- break;
}
- case mf_tray_item_category_sounds:{
- if (update_info) {
- char *size = mf_launch_item_size_calculate((double)update_info->total_size);
- elm_object_part_text_set((g_mf_category_layout.category_sound),"category_sound_size", size);
+ if (g_mf_category_layout.category_sound) {
+ if (storage_status->sound_size_info.total_size >= 0.0) {
+ char *size = mf_launch_item_size_calculate((double)storage_status->sound_size_info.total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_sound), "category_sound_size", size);
SAFE_FREE_CHAR(size);
}
- break;
}
- case mf_tray_item_category_document:{
- if (update_info) {
- char *size = mf_launch_item_size_calculate((double)update_info->total_size);
- elm_object_part_text_set((g_mf_category_layout.category_document),"category_document_size", size);
+ if (g_mf_category_layout.category_document) {
+ if (storage_status->document_size_info.total_size >= 0.0) {
+ char *size = mf_launch_item_size_calculate((double)storage_status->document_size_info.total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_document), "category_document_size", size);
SAFE_FREE_CHAR(size);
}
- break;
}
- case mf_tray_item_category_recent:{
- if (update_info) {
- char *size = mf_launch_item_size_calculate((double)update_info->total_size);
- elm_object_part_text_set((g_mf_category_layout.category_recent),"category_recent_size", size);
+ if (g_mf_category_layout.category_recent) {
+ if (storage_status->recent_size_info.total_size >= 0.0) {
+ char *size = mf_launch_item_size_calculate((double)storage_status->recent_size_info.total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_recent), "category_recent_size", size);
SAFE_FREE_CHAR(size);
}
- break;
}
- default:
- break;
+ break;
+ }
+ case mf_tray_item_category_image: {
+ if (update_info) {
+ char *size = mf_launch_item_size_calculate((double)update_info->total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_image), "category_image_size", size);
+ SAFE_FREE_CHAR(size);
+ }
+ break;
+ }
+ case mf_tray_item_category_video: {
+ if (update_info) {
+ char *size = mf_launch_item_size_calculate((double)update_info->total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_video), "category_video_size", size);
+ SAFE_FREE_CHAR(size);
+ }
+ break;
+ }
+ case mf_tray_item_category_sounds: {
+ if (update_info) {
+ char *size = mf_launch_item_size_calculate((double)update_info->total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_sound), "category_sound_size", size);
+ SAFE_FREE_CHAR(size);
+ }
+ break;
+ }
+ case mf_tray_item_category_document: {
+ if (update_info) {
+ char *size = mf_launch_item_size_calculate((double)update_info->total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_document), "category_document_size", size);
+ SAFE_FREE_CHAR(size);
+ }
+ break;
+ }
+ case mf_tray_item_category_recent: {
+ if (update_info) {
+ char *size = mf_launch_item_size_calculate((double)update_info->total_size);
+ elm_object_part_text_set((g_mf_category_layout.category_recent), "category_recent_size", size);
+ SAFE_FREE_CHAR(size);
+ }
+ break;
+ }
+ default:
+ break;
}
MF_TRACE_END;
}
{
MF_TRACE_BEGIN;
mf_retm_if(data == NULL, "data is NULL");
- struct appdata *ap = (struct appdata *)mf_get_appdata();
+ struct appdata *ap = (struct appdata *)mf_get_appdata();
int category = (int) data;
mf_debug("the category = %d", category);
Evas_Event_Key_Down *ev = event_info;
mf_retm_if(ev == NULL, "ev is NULL");
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
return;
+ }
- if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter")) || (!strcmp(ev->keyname, "space")))
- {
+ if ((!strcmp(ev->keyname, "Return")) || (!strcmp(ev->keyname, "KP_Enter")) || (!strcmp(ev->keyname, "space"))) {
if (category != mf_tray_item_category_none) {
mf_tray_item_search(ap, category);
}
g_mf_category_layout.category_recent = mf_object_create_layout(parent, MF_CATEGORY_LAYOUT_EDJ, "group_category_recent");
mf_retvm_if(g_mf_category_layout.category_recent == NULL, NULL, "category_recent_files is NULL");
//g_mf_category_layout.category_all = mf_object_create_layout(parent, MF_CATEGORY_LAYOUT_EDJ, "group_category_all_files");
- //mf_retvm_if(g_mf_category_layout.category_all == NULL, NULL, "category_all_files is NULL");
+ //mf_retvm_if(g_mf_category_layout.category_all == NULL, NULL, "category_all_files is NULL");
g_mf_category_layout.category_image = mf_object_create_layout(parent, MF_CATEGORY_LAYOUT_EDJ, "group_category_image");
mf_retvm_if(g_mf_category_layout.category_image == NULL, NULL, "category_image is NULL");
g_mf_category_layout.category_video = mf_object_create_layout(parent, MF_CATEGORY_LAYOUT_EDJ, "group_category_video");
elm_object_part_content_set(g_mf_category_layout.category_frame, "category_text", g_mf_category_layout.category_text);
evas_object_show(g_mf_category_layout.category_text);
elm_object_part_content_set(g_mf_category_layout.category_frame, "1", g_mf_category_layout.category_recent);
- evas_object_show(g_mf_category_layout.category_recent);
+ evas_object_show(g_mf_category_layout.category_recent);
elm_object_part_content_set(g_mf_category_layout.category_frame, "2", g_mf_category_layout.category_image);
evas_object_show(g_mf_category_layout.category_image);
elm_object_part_content_set(g_mf_category_layout.category_frame, "3", g_mf_category_layout.category_video);
{
MF_TRACE_BEGIN;
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_image),
- "category_image,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_image);
+ "category_image,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_image);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_video),
- "category_video,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_video);
+ "category_video,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_video);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_sound),
- "category_sound,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_sounds);
+ "category_sound,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_sounds);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_document),
- "category_document,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_document);
+ "category_document,clicked", "background_signal", __mf_category_item_clicked, (void *)mf_tray_item_category_document);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_recent),
- "category_recent,clicked", "background_signal", __mf_category_recent_item_clicked, NULL);
+ "category_recent,clicked", "background_signal", __mf_category_recent_item_clicked, NULL);
}
void __mf_category_item_del_click_callback(void *data)
{
MF_TRACE_BEGIN;
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_image),
- "category_image,clicked", "background_signal", __mf_category_item_clicked);
+ "category_image,clicked", "background_signal", __mf_category_item_clicked);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_video),
- "category_video,clicked", "background_signal", __mf_category_item_clicked);
+ "category_video,clicked", "background_signal", __mf_category_item_clicked);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_sound),
- "category_sound,clicked", "background_signal", __mf_category_item_clicked);
+ "category_sound,clicked", "background_signal", __mf_category_item_clicked);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_document),
- "category_document,clicked", "background_signal", __mf_category_item_clicked);
+ "category_document,clicked", "background_signal", __mf_category_item_clicked);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_recent),
- "category_recent,clicked", "background_signal", __mf_category_recent_item_clicked);
+ "category_recent,clicked", "background_signal", __mf_category_recent_item_clicked);
}
void __mf_category_item_add_release_callback(void *data)
{
MF_TRACE_BEGIN;
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_image),
- "category_image,released", "released_signal", __mf_category_item_released, NULL);
+ "category_image,released", "released_signal", __mf_category_item_released, NULL);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_video),
- "category_video,released", "released_signal", __mf_category_item_released, NULL);
+ "category_video,released", "released_signal", __mf_category_item_released, NULL);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_sound),
- "category_sound,released", "released_signal", __mf_category_item_released, NULL);
+ "category_sound,released", "released_signal", __mf_category_item_released, NULL);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_document),
- "category_document,released", "released_signal", __mf_category_item_released, NULL);
+ "category_document,released", "released_signal", __mf_category_item_released, NULL);
edje_object_signal_callback_add(_EDJ(g_mf_category_layout.category_recent),
- "category_recent,released", "released_signal", __mf_category_item_released, NULL);
+ "category_recent,released", "released_signal", __mf_category_item_released, NULL);
}
void __mf_category_item_del_release_callback(void *data)
{
MF_TRACE_BEGIN;
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_image),
- "category_image,released", "released_signal", __mf_category_item_released);
+ "category_image,released", "released_signal", __mf_category_item_released);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_video),
- "category_video,released", "released_signal", __mf_category_item_released);
+ "category_video,released", "released_signal", __mf_category_item_released);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_sound),
- "category_sound,released", "released_signal", __mf_category_item_released);
+ "category_sound,released", "released_signal", __mf_category_item_released);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_document),
- "category_document,released", "released_signal", __mf_category_item_released);
+ "category_document,released", "released_signal", __mf_category_item_released);
edje_object_signal_callback_del(_EDJ(g_mf_category_layout.category_recent),
- "category_recent,released", "released_signal", __mf_category_item_released);
+ "category_recent,released", "released_signal", __mf_category_item_released);
}
int more = ap->mf_Status.more;
if (more == MORE_DATA_COPYING ||
- more == MORE_DATA_MOVING ||
- more == MORE_DATA_DECOMPRESSING ||
- more == MORE_DELETE ||
- more ==MORE_COMPRESS)
- {
+ more == MORE_DATA_MOVING ||
+ more == MORE_DATA_DECOMPRESSING ||
+ more == MORE_DELETE ||
+ more == MORE_COMPRESS) {
return EINA_TRUE;
}
return EINA_FALSE;
if (ap->mf_MainWindow.pNaviGenlist) {
it = elm_genlist_first_item_get(ap->mf_MainWindow.pNaviGenlist);
while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal && it_data->list_type != mf_list_recent_files) {
- it = elm_genlist_item_next_get(it);
- continue;
- }
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal && it_data->list_type != mf_list_recent_files) {
+ it = elm_genlist_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {
- it = elm_genlist_item_next_get(it);
+ it = elm_genlist_item_next_get(it);
continue;
}
SECURE_DEBUG("itemData->m_ItemName->str is [%s]", itemData->m_ItemName->str);
mf_view_refresh_thumbnail_destroy();
mf_error();
if (ap->mf_Status.more == MORE_DEFAULT || ap->mf_Status.more == MORE_INTERNAL_COPY_MOVE ||
- ap->mf_Status.more == MORE_INTERNAL_COPY || ap->mf_Status.more == MORE_INTERNAL_MOVE ||
- ap->mf_Status.more == MORE_DATA_COPYING || ap->mf_Status.more == MORE_DATA_MOVING ||
- ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS
- || ap->mf_Status.more == MORE_EDIT_RENAME) {
+ ap->mf_Status.more == MORE_INTERNAL_COPY || ap->mf_Status.more == MORE_INTERNAL_MOVE ||
+ ap->mf_Status.more == MORE_DATA_COPYING || ap->mf_Status.more == MORE_DATA_MOVING ||
+ ap->mf_Status.more == MORE_INTERNAL_DECOMPRESS
+ || ap->mf_Status.more == MORE_EDIT_RENAME) {
mf_error();
if (ap->mf_Status.view_type == mf_view_root) {
mf_root_view_create(ap);
it = elm_genlist_item_append(parent, ap->mf_gl_style.itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, mf_genlist_gl_selected, ap);
if (ap->mf_Status.EnterFrom) {
if (!g_strcmp0(m_TempItem->m_ItemName->str, ap->mf_Status.EnterFrom)) {
- ap->mf_Status.ToTop = true ;
- SAFE_FREE_CHAR(ap->mf_Status.EnterFrom);
+ ap->mf_Status.ToTop = true ;
+ SAFE_FREE_CHAR(ap->mf_Status.EnterFrom);
}
}
}
return it;
}
-Elm_Object_Item *mf_view_item_append_with_data(Evas_Object *parent, mfItemData_s *item_data, void *data, void *itc, Evas_Smart_Cb func,void *user_data)
+Elm_Object_Item *mf_view_item_append_with_data(Evas_Object *parent, mfItemData_s *item_data, void *data, void *itc, Evas_Smart_Cb func, void *user_data)
{
mf_retvm_if(parent == NULL, NULL, "pGenlist is NULL");
mf_retvm_if(data == NULL, NULL, "data is NULL");
{
struct appdata *ap = (struct appdata *)data;
if (ap->mf_Status.more == MORE_SEARCH || ap->mf_Status.more == MORE_ADVANCED_SEARCH ||
- mf_view_get_pre_state(ap) == MORE_SEARCH || mf_view_get_pre_state(ap) == MORE_ADVANCED_SEARCH) {
+ mf_view_get_pre_state(ap) == MORE_SEARCH || mf_view_get_pre_state(ap) == MORE_ADVANCED_SEARCH) {
return EINA_TRUE;
}
/*owner should make the followed routine as common function*/
if (ap->mf_MainWindow.pNaviGengrid) {
it = elm_gengrid_first_item_get(ap->mf_MainWindow.pNaviGengrid);
- while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal) {
- it = elm_gengrid_item_next_get(it);
- continue;
- }
+ while (it) {
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal) {
+ it = elm_gengrid_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {
continue;
/*owner should make the followed routine as common function*/
if (ap->mf_MainWindow.pNaviGenlist) {
it = elm_genlist_first_item_get(ap->mf_MainWindow.pNaviGenlist);
- while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal) {
- it = elm_genlist_item_next_get(it);
- continue;
- }
+ while (it) {
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal) {
+ it = elm_genlist_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {
mf_debug();
/*owner should make the followed routine as common function*/
if (ap->mf_MainWindow.pNaviGengrid) {
it = elm_gengrid_first_item_get(ap->mf_MainWindow.pNaviGengrid);
- while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal) {
- it = elm_gengrid_item_next_get(it);
- continue;
- }
+ while (it) {
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal) {
+ it = elm_gengrid_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {
continue;
if (ap->mf_MainWindow.pNaviGenlist) {
it = elm_genlist_first_item_get(ap->mf_MainWindow.pNaviGenlist);
while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal) {
- it = elm_genlist_item_next_get(it);
- continue;
- }
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal) {
+ it = elm_genlist_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {
mf_debug();
if (ap->mf_MainWindow.pNaviGengrid) {
it = elm_gengrid_first_item_get(ap->mf_MainWindow.pNaviGengrid);
while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal) {
- it = elm_gengrid_item_next_get(it);
- continue;
- }
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal) {
+ it = elm_gengrid_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {
continue;
/*owner should make the followed routine as common function*/
if (ap->mf_MainWindow.pNaviGenlist) {
it = elm_genlist_first_item_get(ap->mf_MainWindow.pNaviGenlist);
- while (it) {
- mf_list_data_t *it_data = elm_object_item_data_get(it);
- if (it_data->list_type != mf_list_normal) {
- it = elm_genlist_item_next_get(it);
- continue;
- }
+ while (it) {
+ mf_list_data_t *it_data = elm_object_item_data_get(it);
+ if (it_data->list_type != mf_list_normal) {
+ it = elm_genlist_item_next_get(it);
+ continue;
+ }
itemData = elm_object_item_data_get(it);
if (itemData->m_ItemName == NULL || itemData->m_ItemName->str == NULL) {