summaryrefslogtreecommitdiff
path: root/src/common/file-system/mf-ug-file-attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/file-system/mf-ug-file-attr.c')
-rw-r--r--src/common/file-system/mf-ug-file-attr.c13
1 files changed, 10 insertions, 3 deletions
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)