summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgliang.wang <gliang.wang@samsung.com>2012-09-04 08:35:53 +0800
committergliang.wang <gliang.wang@samsung.com>2012-09-04 08:35:53 +0800
commitb5cd76875ed767e133f4077321d411654a5674a0 (patch)
tree3392eba68ecfbc05525cfdcde662dae53ea4c476
parent95ec5bfcb8c52ecc651e4947ea74dfbd2cf715c0 (diff)
downloadug-myfile-efl-b5cd76875ed767e133f4077321d411654a5674a0.tar.gz
ug-myfile-efl-b5cd76875ed767e133f4077321d411654a5674a0.tar.bz2
ug-myfile-efl-b5cd76875ed767e133f4077321d411654a5674a0.zip
[SR][s1-8344] vconf bs
-rw-r--r--packaging/ug-myfile-efl.spec2
-rw-r--r--src/common/file-system/mf-ug-file-attr.c13
-rw-r--r--src/common/mf-ug-cb.c41
-rw-r--r--src/include/mf-ug-fs-util.h2
-rw-r--r--src/include/mf-ug-util.h7
-rw-r--r--src/mf-ug-main.c1
-rw-r--r--src/widget/mf-ug-genlist.c3
7 files changed, 52 insertions, 17 deletions
diff --git a/packaging/ug-myfile-efl.spec b/packaging/ug-myfile-efl.spec
index b924048..b2ddf6c 100644
--- a/packaging/ug-myfile-efl.spec
+++ b/packaging/ug-myfile-efl.spec
@@ -1,7 +1,7 @@
#sbs-git:slp/pkgs/u/ug-myfile-efl ug-myfile-efl 0.0.1 1b44640a2e59d1af1ab0792e39a73bf3680b25c9
Name: ug-myfile-efl
Summary: Myfile UI Gadget (EFL)
-Version: 0.0.24
+Version: 0.0.25
Release: 1
Group: misc
License: flora
diff --git a/src/common/file-system/mf-ug-file-attr.c b/src/common/file-system/mf-ug-file-attr.c
index 58ef220..7a219ba 100644
--- a/src/common/file-system/mf-ug-file-attr.c
+++ b/src/common/file-system/mf-ug-file-attr.c
@@ -977,11 +977,12 @@ const char *mf_ug_file_attr_get_thumbnail(void *data)
return ret;
}
-char *mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code)
+int mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code, char **thumbnail)
{
int index = 0;
char *icon_path = NULL;
mf_ug_fs_file_type ftype = UG_FILE_TYPE_NONE;
+ int thumbnail_type = MF_UG_THUMBNAIL_TYPE_DEFAULT;
char *thumbnail_path = NULL;
char mime[255] = { '\0', };
@@ -1000,6 +1001,9 @@ char *mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code)
}
}
+ icon_path = __mf_ug_file_attr_default_icon_get_by_type(ftype);
+ ug_debug("ftype is [%d] icon_path is [%s]", ftype, icon_path);
+
switch (ftype) {
case UG_FILE_TYPE_IMAGE:
case UG_FILE_TYPE_VIDEO:
@@ -1011,6 +1015,7 @@ char *mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code)
err = mf_ug_file_attr_get_thumbnail(&tmp_data);//minfo_get_thumb_path(handle, file_path, image_thumb, sizeof(image_thumb));
if (err == 0) {
icon_path = g_strdup(tmp_data.thumbnail_path);
+ thumbnail_type = MF_UG_THUMBNAIL_TYPE_THUMBNAIL;
} else {
icon_path = NULL;
if (error_code)
@@ -1020,12 +1025,14 @@ char *mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code)
break;
default:
icon_path = __mf_ug_file_attr_default_icon_get_by_type(ftype);
+ thumbnail_type = MF_UG_THUMBNAIL_TYPE_DEFAULT;
break;
}
- ug_mf_debug("mime [%s], file type [%d], icon_path [%s]", mime, ftype, icon_path);
+ ug_debug("mime [%s], file type [%d], icon_path [%s]", mime, ftype, icon_path);
+ *thumbnail = icon_path;
- return icon_path;
+ return thumbnail_type;
}
static int mf_ug_file_attr_get_path_level(const char *fullpath, int *level)
diff --git a/src/common/mf-ug-cb.c b/src/common/mf-ug-cb.c
index f59daa1..418452d 100644
--- a/src/common/mf-ug-cb.c
+++ b/src/common/mf-ug-cb.c
@@ -1112,19 +1112,38 @@ Eina_Bool mf_ug_cb_thumb_timer_cb(void *data)
elm_genlist_item_update(it);
} else if (ecore_file_exists(item_data->ug_pItemName->str)) {
- char *new_thumb = mf_ug_file_attr_get_file_icon(item_data->ug_pItemName->str, NULL);
+ char *new_thumb = NULL;
+ int thumbnail_type = 0;
+ thumbnail_type = mf_ug_file_attr_get_file_icon(item_data->ug_pItemName->str, NULL, &new_thumb);
if (new_thumb) {
- if (item_data->ug_pThumbPath) {
- free(item_data->ug_pThumbPath);
- item_data->ug_pThumbPath = NULL;
+ if (thumbnail_type == MF_UG_THUMBNAIL_TYPE_DEFAULT) {
+ if (item_data->ug_pThumbPath && g_strcmp0(new_thumb, item_data->ug_pThumbPath) == 0) {
+ allright_flag = FALSE;
+ } else {
+ if (item_data->ug_pThumbPath) {
+ free(item_data->ug_pThumbPath);
+ item_data->ug_pThumbPath = NULL;
+ }
+ item_data->ug_pThumbPath = strdup(new_thumb);
+ item_data->ug_bRealThumbFlag = TRUE;
+ elm_object_item_data_set(it, item_data);
+ elm_genlist_item_update(it);
+ free(new_thumb);
+ new_thumb = NULL;
+ }
+
+ } else {
+ if (item_data->ug_pThumbPath) {
+ free(item_data->ug_pThumbPath);
+ item_data->ug_pThumbPath = NULL;
+ }
+ item_data->ug_pThumbPath = strdup(new_thumb);
+ item_data->ug_bRealThumbFlag = TRUE;
+ elm_object_item_data_set(it, item_data);
+ elm_genlist_item_update(it);
+ free(new_thumb);
+ new_thumb = NULL;
}
- item_data->ug_pThumbPath = strdup(new_thumb);
- item_data->ug_bRealThumbFlag = true;
- elm_object_item_data_set(it, item_data);
- elm_genlist_item_update(it);
-
- free(new_thumb);
- new_thumb = NULL;
} else {
allright_flag = false;
}
diff --git a/src/include/mf-ug-fs-util.h b/src/include/mf-ug-fs-util.h
index 6b67fb4..9383023 100644
--- a/src/include/mf-ug-fs-util.h
+++ b/src/include/mf-ug-fs-util.h
@@ -315,7 +315,7 @@ int mf_ug_file_attr_is_valid_name(const char *filename);
int mf_ug_fs_oper_read_dir(const char *path, Eina_List **dir_list, Eina_List **file_list);
int mf_ug_fs_oper_list_filter(Eina_List *in_list, Eina_List **out_list, int option, int drm_opt);
int mf_ug_fs_oper_list_filter_by_extension(Eina_List *in_list, Eina_List **out_list, char *ext);
-char *mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code);
+int mf_ug_file_attr_get_file_icon(const char *file_path, int *error_code, char **thumbnail);
mf_ug_drm_file_mime_type mf_ug_fs_oper_get_drm_type(char *path);
int mf_ug_file_attr_is_system_dir(char *fullpath, bool * result);
mf_ug_fs_file_type mf_ug_file_attr_get_file_type_by_mime(const char *file_path);
diff --git a/src/include/mf-ug-util.h b/src/include/mf-ug-util.h
index e8e9bc3..43cd830 100644
--- a/src/include/mf-ug-util.h
+++ b/src/include/mf-ug-util.h
@@ -230,6 +230,13 @@ enum _mf_ug_file_name_type_e {
FILE_NAME_NONE,
};
+typedef enum __mf_ug_thumbnail_type_e mf_ug_thumbnail_type_e;
+enum __mf_ug_thumbnail_type_e {
+ MF_UG_THUMBNAIL_TYPE_DEFAULT,
+ MF_UG_THUMBNAIL_TYPE_THUMBNAIL,
+ MF_UG_THUMBNAIL_TYPE_MAX
+};
+
bool mf_ug_util_is_mass_storage_on();
int mf_ug_util_create_dir_monitor(void *data);
int mf_ug_util_set_mmc_state_cb(void *data);
diff --git a/src/mf-ug-main.c b/src/mf-ug-main.c
index 29b8c3e..989355d 100644
--- a/src/mf-ug-main.c
+++ b/src/mf-ug-main.c
@@ -1115,6 +1115,7 @@ static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
mf_ug_util_destory_mmc_state_cb();
media_content_disconnect();
mf_ug_util_destory_mass_storage_callback();
+ power_unset_changed_cb();
}
if (0 != ugd->ug_ListPlay.ug_Player) {
diff --git a/src/widget/mf-ug-genlist.c b/src/widget/mf-ug-genlist.c
index fa5195f..92ec41b 100644
--- a/src/widget/mf-ug-genlist.c
+++ b/src/widget/mf-ug-genlist.c
@@ -372,13 +372,14 @@ static void __mf_ug_genlist_get_thumbnail(void *data)
//const char *dir_create_icon_path = UG_ICON_FOLDER_CREATED;
char *icon_path = NULL;
int error_code = MYFILE_ERR_NONE;
+ int thumbnail_type = 0;
if (itemData->ug_pThumbPath == NULL) {
if (ecore_file_is_dir(itemData->ug_pItemName->str)) {
itemData->ug_pThumbPath = strdup(dir_icon_path);
itemData->ug_bRealThumbFlag = true;
} else {
- icon_path = mf_ug_file_attr_get_file_icon(itemData->ug_pItemName->str, &error_code);
+ thumbnail_type = mf_ug_file_attr_get_file_icon(itemData->ug_pItemName->str, &error_code, &icon_path);
if (icon_path) {
itemData->ug_pThumbPath = strdup(icon_path);
itemData->ug_bRealThumbFlag = true;