mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 16:19:44 +00:00
Fix some file browsing issues
This commit is contained in:
parent
ff7c370ecf
commit
c1d0ed08c4
@ -51,6 +51,7 @@ IdentifiedFileType Identify_File(std::string &filename)
|
||||
}
|
||||
|
||||
if (info.isDirectory) {
|
||||
if (filename.size() > 4) {
|
||||
FileInfo ebootInfo;
|
||||
// Check for existence of EBOOT.PBP, as required for "Directory games".
|
||||
if (getFileInfo((filename + "/EBOOT.PBP").c_str(), &ebootInfo)) {
|
||||
@ -67,6 +68,9 @@ IdentifiedFileType Identify_File(std::string &filename)
|
||||
}
|
||||
}
|
||||
|
||||
return FILETYPE_NORMAL_DIRECTORY;
|
||||
}
|
||||
|
||||
FILE *f = fopen(filename.c_str(), "rb");
|
||||
if (!f) {
|
||||
// File does not exists
|
||||
@ -198,6 +202,10 @@ bool LoadFile(std::string &filename, std::string *error_string) {
|
||||
*error_string = "File is compressed (ZIP).\nPlease decompress first (try WinRAR)";
|
||||
break;
|
||||
|
||||
case FILETYPE_NORMAL_DIRECTORY:
|
||||
ERROR_LOG(LOADER, "Just a directory.");
|
||||
break;
|
||||
|
||||
case FILETYPE_UNKNOWN_BIN:
|
||||
case FILETYPE_UNKNOWN_ELF:
|
||||
case FILETYPE_UNKNOWN:
|
||||
|
@ -37,6 +37,8 @@ enum IdentifiedFileType {
|
||||
FILETYPE_ARCHIVE_ZIP,
|
||||
FILETYPE_PSP_PS1_PBP,
|
||||
|
||||
FILETYPE_NORMAL_DIRECTORY,
|
||||
|
||||
FILETYPE_UNKNOWN
|
||||
};
|
||||
|
||||
|
@ -288,6 +288,10 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
case FILETYPE_NORMAL_DIRECTORY:
|
||||
info_->title = gamePath_;
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
std::string fn, ext;
|
||||
|
@ -386,7 +386,7 @@ void GameBrowser::Refresh() {
|
||||
std::vector<FileInfo> fileInfo;
|
||||
path_.GetListing(fileInfo, "iso:cso:pbp:elf:prx:");
|
||||
for (size_t i = 0; i < fileInfo.size(); i++) {
|
||||
if (fileInfo[i].isDirectory && !File::Exists(path_.GetPath() + fileInfo[i].name + "/EBOOT.PBP")) {
|
||||
if (fileInfo[i].isDirectory && (path_.GetPath().size() < 4 || !File::Exists(path_.GetPath() + fileInfo[i].name + "/EBOOT.PBP"))) {
|
||||
// Check if eboot directory
|
||||
if (allowBrowsing_)
|
||||
dirButtons.push_back(new UI::Button(fileInfo[i].name.c_str(), new UI::LinearLayoutParams(UI::FILL_PARENT, UI::FILL_PARENT)));
|
||||
|
Loading…
Reference in New Issue
Block a user