Display .7z files in file listings. Can't decompress them though.

This commit is contained in:
Henrik Rydgard
2014-10-21 00:09:24 +02:00
parent d24abb3af0
commit e6334dd9d8
8 changed files with 29 additions and 3 deletions
+10
View File
@@ -193,6 +193,8 @@ IdentifiedFileType Identify_File(std::string &filename)
return FILETYPE_ARCHIVE_RAR;
} else if (!strcasecmp(extension.c_str(),".r01")) {
return FILETYPE_ARCHIVE_RAR;
} else if (!strcasecmp(extension.substr(1).c_str(), ".7z")) {
return FILETYPE_ARCHIVE_7Z;
}
return FILETYPE_UNKNOWN;
}
@@ -268,6 +270,14 @@ bool LoadFile(std::string &filename, std::string *error_string) {
#endif
break;
case FILETYPE_ARCHIVE_7Z:
#ifdef WIN32
*error_string = "7z file detected (Require 7-Zip)";
#else
*error_string = "7z file detected (Require 7-Zip)";
#endif
break;
case FILETYPE_ISO_MODE2:
*error_string = "PSX game image detected.";
break;
+1
View File
@@ -37,6 +37,7 @@ enum IdentifiedFileType {
// Try to reduce support emails...
FILETYPE_ARCHIVE_RAR,
FILETYPE_ARCHIVE_ZIP,
FILETYPE_ARCHIVE_7Z,
FILETYPE_PSP_PS1_PBP,
FILETYPE_ISO_MODE2,
+15
View File
@@ -445,6 +445,21 @@ handleELF:
}
break;
case FILETYPE_ARCHIVE_7Z:
info_->paramSFOLoaded = true;
{
// Read standard icon
size_t sz;
uint8_t *contents = VFSReadFile("7z.png", &sz);
if (contents) {
lock_guard lock(info_->lock);
info_->iconTextureData = std::string((const char *)contents, sz);
info_->iconDataLoaded = true;
}
delete[] contents;
}
break;
case FILETYPE_NORMAL_DIRECTORY:
default:
info_->paramSFOLoaded = true;
+1 -1
View File
@@ -550,7 +550,7 @@ void GameBrowser::Refresh() {
// to a flood of support email...
if (allowBrowsing_) {
fileInfo.clear();
path_.GetListing(fileInfo, "zip:rar:r01:");
path_.GetListing(fileInfo, "zip:rar:r01:7z:");
if (!fileInfo.empty()) {
UI::LinearLayout *zl = new UI::LinearLayout(UI::ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
zl->SetSpacing(4.0f);
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+1 -1
Submodule lang updated: 0644f2d429...e86e58ff66
+1 -1
Submodule native updated: faca4e72ec...428f338f28
Binary file not shown.