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,20 +51,24 @@ IdentifiedFileType Identify_File(std::string &filename)
|
||||
}
|
||||
|
||||
if (info.isDirectory) {
|
||||
FileInfo ebootInfo;
|
||||
// Check for existence of EBOOT.PBP, as required for "Directory games".
|
||||
if (getFileInfo((filename + "/EBOOT.PBP").c_str(), &ebootInfo)) {
|
||||
if (ebootInfo.exists) {
|
||||
return FILETYPE_PSP_PBP_DIRECTORY;
|
||||
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)) {
|
||||
if (ebootInfo.exists) {
|
||||
return FILETYPE_PSP_PBP_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
// check if it's a disc directory
|
||||
if (getFileInfo((filename + "/PSP_GAME").c_str(), &ebootInfo)) {
|
||||
if (ebootInfo.exists) {
|
||||
return FILETYPE_PSP_DISC_DIRECTORY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check if it's a disc directory
|
||||
if (getFileInfo((filename + "/PSP_GAME").c_str(), &ebootInfo)) {
|
||||
if (ebootInfo.exists) {
|
||||
return FILETYPE_PSP_DISC_DIRECTORY;
|
||||
}
|
||||
}
|
||||
return FILETYPE_NORMAL_DIRECTORY;
|
||||
}
|
||||
|
||||
FILE *f = fopen(filename.c_str(), "rb");
|
||||
@ -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,7 +288,11 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
case FILETYPE_NORMAL_DIRECTORY:
|
||||
info_->title = gamePath_;
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
std::string fn, ext;
|
||||
SplitPath(gamePath_, 0, &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