SET( SRCS
${SRC-DIR}/mf-main.c
${UTILITY-DIR}/mf-callback.c
+ ${UTILITY-DIR}/mf-otg.c
${UTILITY-DIR}/mf-util.c
${UTILITY-DIR}/mf-file-util.c
${UTILITY-DIR}/mf-ta.c
ADD_DEFINITIONS("-DMYFILE_ENABLE_FOCUS")
ADD_DEFINITIONS("-DMYFILE_CATEGORY_VIEW")
ADD_DEFINITIONS("-DMYFILE_HIDEN_FILES_SHOW")
+ADD_DEFINITIONS("-DMYFILE_USB_OTG")
#END_START_PUBLIC_REMOVED_STRING
#ADD_DEFINITIONS("-DMYFILE_DOWNLOAD_APP_FEATURE")
}
buffer = (char*)malloc(len+1);
- strcpy(buffer,newdir);
+ strncpy(buffer,newdir, strlen(newdir));
if (buffer[len-1] == '/') {
buffer[len-1] = '\0';
void *id;
EINA_LIST_FOREACH(ap->edit_file_list, temp, id) {
- if (!strcmp(filename_inzip, (char *)id)) {
+ if (id && !strcmp(filename_inzip, (char *)id)) {
file_found = 1;
break;
} else {
uf = unzOpen(zipfilename);
if (uf==NULL) {
- strcat(filename_try,".zip");
+ strncat(filename_try,".zip", strlen(".zip"));
uf = unzOpen(filename_try);
}
}
- if (uf==NULL) {
+ if (uf == NULL) {
mf_debug("Cannot open %s or %s.zip\n",zipfilename,zipfilename);
return 1;
}
}
if (dot_found==0) {
- strcat(filename_try,".zip");
+ strncat(filename_try,".zip", strlen(".zip"));
} else {
char * ext = strrchr(filename_try, '.');
if (ext) {
*ext = '\0';
}
- strcat(filename_try,".zip");
+ strncat(filename_try,".zip", strlen(".zip"));
}
if (opt_overwrite==2) {
(argv[i][1]=='p') || (argv[i][1]=='P') ||
((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
(strlen(argv[i]) == 2))) {
- FILE * fin;
+ FILE * fin = NULL;
int size_read;
const char* filenameinzip = argv[i];
zip_fileinfo zi;
media_info_clone(tmp_data->media, media);
int retcode = media_info_get_thumbnail_path(media, &(tmp_data->thumb_path));
if (retcode != MEDIA_CONTENT_ERROR_NONE) {
- mf_debug("Get media thumbnail path failed!![%d]", retcode);
+ mf_error("Get media thumbnail path failed!![%d]", retcode);
}
return false;
return thumbnail_type;
}
- mf_error("mime is [%s]", mime);
+ mf_debug("mime is [%s]", mime);
for (index = 0; mime_type[index].mime; index++) {
if (strncmp(mime, mime_type[index].mime, strlen(mime)) == 0) {
ftype_by_mime = mime_type[index].ftype;
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);
char *text = strdup(str);
text = strrchr(text,'/');
- text++;
- char * ext = strrchr(text, '.');
- if(ext){
- *ext = '\0';
- }
+ if (text) {
+ text++;
+ char * ext = strrchr(text, '.');
+ if (ext){
+ *ext = '\0';
+ }
- elm_entry_entry_set(en, text);
+ elm_entry_entry_set(en, text);
+ }
elm_entry_select_all(en);
mf_object_text_set(popup, LABEL_RENAME_CHAP, "title,text");
pListData);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
mf_debug("Failed to create thumbnail! ret is [%d]", ret);
+ mf_debug("Switching back to default image");
if (pListData->file_type == FILE_TYPE_IMAGE || pListData->file_type == FILE_TYPE_VIDEO) {
- pListData->thumb_path = g_strdup(pListData->m_ItemName->str);
+ pListData->thumb_path = g_strdup(mf_file_attr_get_default_icon_by_type(pListData->file_type));
}
return -1;
} else {
}
snprintf(olddir,strlen(temp)+8, "rm -rf %s", temp);
- if (temp) {
- g_free(temp);
- }
+
mf_debug("old dir is %s", olddir);
int err = system(olddir);
if (err == -1) {
+ SAFE_FREE_G_CHAR(temp);
mf_debug("unable to delete file");
return;
} else {
char *ptemp = strrchr(dest, '.');
if (ptemp) {
*ptemp = '\0';
+ strncpy(ptemp, "\0\0\0\0", 4);
}
- strncpy(ptemp, "\0\0\0\0", 4);
ap->dir_name = g_strdup(dest);
mf_file_decompression_start(ap);
+
+ SAFE_FREE_G_CHAR(temp);
return;
}
char *ptr = strstr(dest_string, ".zip");
if (ptr) {
- strcpy(ptr,"\0");
+ ptr = NULL;
}
GString *fullpath = g_string_new(dest_string);
GString *filename = NULL;
l = source_folder_list;
}
it = eina_list_data_get(l);
- dest_name = g_strdup(it->str);
+ if (it && it>str) {
+ dest_name = g_strdup(it->str);
+ }
} else{
if(mf_util_get_eina_list_len(source_file_list)) {
it = eina_list_last_data_get(source_file_list);
char * ext = strrchr(dest_name, '/');
- if(ext){
+ if (ext){
ext++;
+ snprintf(str, strlen(dest_name)+strlen(ext)+7, "%s/%s.zip", dest_name, ext );
}
- snprintf(str, strlen(dest_name)+strlen(ext)+7, "%s/%s.zip", dest_name, ext );
mf_debug("\destination is %s", dest_name);
mf_debug("string dest is %s", str);
char *ptemp = strrchr(dest, '.');
if (ptemp) {
*ptemp = '\0';
+ strncpy(ptemp, "\0\0\0\0", 4);
}
- strncpy(ptemp, "\0\0\0\0", 4);
mf_debug("directory name is %s", dest);
*filename = mf_fm_svc_wrapper_get_file_parent_path(fullpath);
GString *file_name = mf_fm_svc_wrapper_get_file_name(fullpath);
- mf_debug("filename is %s", (*filename)->str);
-
if (*filename == NULL || file_name == NULL) {
return MYFILE_ERR_GENERATE_NAME_FAIL;
}
+
+ mf_debug("filename is %s", (*filename)->str);
+
if ((*filename)->str == NULL || file_name->str == NULL) {
mf_debug("filename->str is NULL");
g_string_free(*filename, TRUE);
#include <app.h>
#include <Elementary.h>
#include <system_settings.h>
-#include <E_DBus.h>
#include <gio/gio.h>
#include "mf-download-app.h"
_mf_thumb_gen_lock();
if (pThumbGen->bIsRealize == FALSE) {
- mf_debug(" == pThumbGen->bIsRealize is Fail ==");
+ mf_debug("pThumbGen->bIsRealize is Fail");
_mf_thumb_gen_unlock();
return 0;
}
thumbnail_h thumb_handle;
while (true) {
list_tmp = file_list->prev;
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>list_tmp = %p", list_tmp);
+ MF_THUMBNAIL_DEBUG("list_tmp = %p", list_tmp);
if (list_tmp == NULL) {
break;
} else {
}
}
- 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);
+ MF_THUMBNAIL_DEBUG("path = %s", path);
+ MF_THUMBNAIL_DEBUG("file_list = %x", pThumbGen->file_list);
+ MF_THUMBNAIL_DEBUG("file count is [%d]", file_count);
EINA_LIST_FOREACH(file_list, l, pNode) {
if (pNode) {
}
if (pNode != NULL && pNode->name != NULL && pNode->path != NULL) {
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->path = %s, pNode->name=%s", pNode->path, pNode->name);
+ MF_THUMBNAIL_DEBUG("pNode->path = %s, pNode->name = %s, pNode->type = %d", pNode->path, pNode->name, pNode->type);
switch (pNode->type) {
case FILE_TYPE_IMAGE:
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");
+ mf_debug("thumbnail path %s and name : %s", pNode->path, pNode->name);
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);
+ MF_THUMBNAIL_DEBUG("pNode->thumbnail_path = %s", pNode->thumbnail_path);
thumbnail_util_create(&thumb_handle);
if (thumb_handle) {
thumbnail_util_set_path(thumb_handle, tmp_path);
if (pThumbGen->bIscancel == true) {
goto EXIT;
}
- MF_THUMBNAIL_DEBUG("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pNode->thumbnail_path2 = %s", pNode->thumbnail_path);
+ MF_THUMBNAIL_DEBUG("pNode->thumbnail_path = %s", pNode->thumbnail_path);
break;
}
default:
uf = unzOpen(source_name);
if (uf==NULL)
{
- strcat(source_name,".zip");
+ strncat(source_name,".zip", strlen(".zip"));
uf = unzOpen(source_name);
}
int error_code = 0;
if (params->file_type == FILE_TYPE_DIR) {
mf_error("params->thumb_path is [%s]", params->thumb_path);
- //if (params->storage_type == MYFILE_MMC) {
params->thumb_path = strdup(MF_ICON_FOLDER);
- //} else {
- // params->thumb_path = strdup(MF_ICON_FOLDER);
- //}
params->real_thumb_flag = TRUE;
params->thumbnail_type = MF_THUMBNAIL_DEFAULT;
} else { /* nor directory */
params->real_thumb_flag = TRUE;
params->thumbnail_type = MF_THUMBNAIL_THUMB;
} else { /* must be image/video file */
-
if (params->file_type == FILE_TYPE_VIDEO) {
params->thumb_path = strdup(MF_ICON_VIDEO);
} else if (params->file_type == FILE_TYPE_IMAGE) {
char *path = app_get_resource_path();
snprintf(edj_path, 1024, "%s%s/%s", path, "edje", EDJ_IMAGE);
if (!strcmp(part, "elm.icon.folder")) {
-
-
if (params->list_type == mf_list_shortcut) {
mf_debug("image need to be added here");
Evas_Object *img = elm_image_add(obj);
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");
thumb = elm_image_add(obj);
elm_image_prescale_set(thumb, MF_GENLIST_THUMBNAIL_SIZE);
}
} else {
if (g_is_refresh_at_glist == false) {
- mf_debug("1");
mf_view_refresh_thumbnail_for_other_memory(ap, ap->mf_FileOperation.file_list);
} else {
- mf_debug("2");
if (params->pNode && params->pNode->thumbnail_path) { //For supporting the otg thumbnail
- mf_debug("21 params->pNode->thumbnail_path=%s", params->pNode->thumbnail_path);
+ mf_debug("params->pNode->thumbnail_path=%s", params->pNode->thumbnail_path);
//elm_image_file_set(thumb, EDJ_IMAGE, params->pNode->thumbnail_path);
elm_image_file_set(thumb, params->pNode->thumbnail_path, NULL);
//elm_object_part_content_set(layout, "default_thumbnail", thumb);
//elm_layout_content_set(layout, "elm.swallow.content", thumb);
} else {
- mf_debug("22");
thumb = elm_image_add(obj);
elm_image_fill_outside_set(thumb, EINA_TRUE);
if (params->file_type == FILE_TYPE_IMAGE) {
elm_image_fill_outside_set(thumb, EINA_FALSE);
elm_image_smooth_set(thumb, EINA_FALSE);
if (is_using_original_image_at_phone_or_mmc) {//Fixed the P131112-03632.
- 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);
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("53");
//elm_image_file_set(thumb, EDJ_IMAGE, params->pNode->thumbnail_path);
elm_image_file_set(thumb, params->pNode->thumbnail_path, NULL);
// elm_object_part_content_set(layout, "default_thumbnail", thumb);
}
} else {
if (!(m_TempItem->real_thumb_flag && m_TempItem->thumb_path)) {
- //mf_genlist_get_thumbnail(m_TempItem);
- //SECURE_ERROR("================= thumbnail is [%s]", m_TempItem->thumb_path);
+ /*mf_genlist_get_thumbnail(m_TempItem);
+ SECURE_ERROR("================= thumbnail is [%s]", m_TempItem->thumb_path);*/
}
}