ap->mf_MainWindow.pMmcRemovedPopup = NULL;
}
//mf_navi_bar_title_set(ap);
- free(storage_loc);
+ SAFE_FREE_CHAR(storage_loc);
}
static void __mf_callback_storage_changed_cb(int storage_id,
if (STORAGE_STATE_MOUNTED == state) {
mf_debug("Storage State Mounted");
if (strstr(temp_path, "sdcard") && (ap->mf_Status.iStorageState & MYFILE_MMC)) {
- __mf_callback_mmc_connected(ap);
mf_set_usb_storage_id(storage_id);
+ __mf_callback_mmc_connected(ap);
} else if (strstr(temp_path, "usb") && (ap->mf_Status.iStorageState & MYFILE_OTG)) {
- mf_callback_otg_connected_cb(ap);
mf_set_otg_storage_id(storage_id);
+ mf_callback_otg_connected_cb(ap);
} else {
mf_debug("No external storage detected... Returning... [%d]", ap->mf_Status.iStorageState);
}
} else if (!g_strcmp0(ap->mf_Status.path->str, OTG_FOLDER) && (ap->mf_Status.iStorageState & MYFILE_OTG) && !__mf_util_storage_exist_check(parent, MYFILE_OTG)) {
mf_view_item_append(parent, pNode, ap);
}
- free(STORAGE_PARENT);
}
}
MF_CHECK(ap);
ap->otg_id = id;
if (id == -1) {
- ap->otg_storage_path = "";
+ ap->otg_storage_path = strdup("");
+ ap->otg_parent_path = strdup("");
+ ap->otg_storage_name = strdup("");
} else {
char *path;
storage_get_root_directory(id, &path);
ap->otg_storage_path = strdup(path);
+ mf_file_attr_get_parent_path(path, &ap->otg_parent_path);
+ ap->otg_storage_name = strdup(mf_storage_file_get(path));
free(path);
}
MF_TRACE_END
MF_CHECK(ap);
ap->mmc_id = id;
if (id == -1) {
- ap->mmc_storage_path = "";
+ ap->mmc_storage_path = strdup("");
+ ap->mmc_parent_path = strdup("");
+ ap->mmc_storage_name = strdup("");
} else {
char *path;
storage_get_root_directory(id, &path);
ap->mmc_storage_path = strdup(path);
+ mf_file_attr_get_parent_path(path, &ap->mmc_parent_path);
+ ap->mmc_storage_name = strdup(mf_storage_file_get(path));
free(path);
}
MF_TRACE_END