DolphinQt: Show WAD as "WAD" instead of "" in file format column
https://bugs.dolphin-emu.org/issues/12190
This commit is contained in:
parent
487cd7abd9
commit
fe5e92f706
|
@ -168,12 +168,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||||
break;
|
break;
|
||||||
case COL_FILE_FORMAT:
|
case COL_FILE_FORMAT:
|
||||||
if (role == Qt::DisplayRole || role == SORT_ROLE)
|
if (role == Qt::DisplayRole || role == SORT_ROLE)
|
||||||
{
|
return QString::fromStdString(game.GetFileFormatName());
|
||||||
if (game.ShouldShowFileFormatDetails())
|
|
||||||
return QString::fromStdString(DiscIO::GetName(game.GetBlobType(), true));
|
|
||||||
else
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case COL_BLOCK_SIZE:
|
case COL_BLOCK_SIZE:
|
||||||
if (role == Qt::DisplayRole)
|
if (role == Qt::DisplayRole)
|
||||||
|
|
|
@ -336,14 +336,17 @@ void GameFile::DoState(PointerWrap& p)
|
||||||
m_custom_cover.DoState(p);
|
m_custom_cover.DoState(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GameFile::GetExtension() const
|
||||||
|
{
|
||||||
|
std::string extension;
|
||||||
|
SplitPath(m_file_path, nullptr, nullptr, &extension);
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
|
|
||||||
bool GameFile::IsElfOrDol() const
|
bool GameFile::IsElfOrDol() const
|
||||||
{
|
{
|
||||||
if (m_file_path.size() < 4)
|
const std::string extension = GetExtension();
|
||||||
return false;
|
return extension == ".elf" || extension == ".dol";
|
||||||
|
|
||||||
std::string name_end = m_file_path.substr(m_file_path.size() - 4);
|
|
||||||
std::transform(name_end.begin(), name_end.end(), name_end.begin(), ::tolower);
|
|
||||||
return name_end == ".elf" || name_end == ".dol";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameFile::ReadXMLMetadata(const std::string& path)
|
bool GameFile::ReadXMLMetadata(const std::string& path)
|
||||||
|
@ -592,6 +595,25 @@ bool GameFile::ShouldShowFileFormatDetails() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GameFile::GetFileFormatName() const
|
||||||
|
{
|
||||||
|
switch (m_platform)
|
||||||
|
{
|
||||||
|
case DiscIO::Platform::WiiWAD:
|
||||||
|
return "WAD";
|
||||||
|
case DiscIO::Platform::ELFOrDOL:
|
||||||
|
{
|
||||||
|
std::string extension = GetExtension();
|
||||||
|
std::transform(extension.begin(), extension.end(), extension.begin(), ::toupper);
|
||||||
|
|
||||||
|
// substr removes the dot
|
||||||
|
return extension.substr(std::min<size_t>(1, extension.size()));
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return DiscIO::GetName(m_blob_type, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const GameBanner& GameFile::GetBannerImage() const
|
const GameBanner& GameFile::GetBannerImage() const
|
||||||
{
|
{
|
||||||
return m_custom_banner.empty() ? m_volume_banner : m_custom_banner;
|
return m_custom_banner.empty() ? m_volume_banner : m_custom_banner;
|
||||||
|
|
|
@ -89,6 +89,7 @@ public:
|
||||||
u64 GetBlockSize() const { return m_block_size; }
|
u64 GetBlockSize() const { return m_block_size; }
|
||||||
const std::string& GetCompressionMethod() const { return m_compression_method; }
|
const std::string& GetCompressionMethod() const { return m_compression_method; }
|
||||||
bool ShouldShowFileFormatDetails() const;
|
bool ShouldShowFileFormatDetails() const;
|
||||||
|
std::string GetFileFormatName() const;
|
||||||
const std::string& GetApploaderDate() const { return m_apploader_date; }
|
const std::string& GetApploaderDate() const { return m_apploader_date; }
|
||||||
u64 GetFileSize() const { return m_file_size; }
|
u64 GetFileSize() const { return m_file_size; }
|
||||||
u64 GetVolumeSize() const { return m_volume_size; }
|
u64 GetVolumeSize() const { return m_volume_size; }
|
||||||
|
@ -115,6 +116,7 @@ private:
|
||||||
const std::map<DiscIO::Language, std::string>& strings);
|
const std::map<DiscIO::Language, std::string>& strings);
|
||||||
const std::string&
|
const std::string&
|
||||||
LookupUsingConfigLanguage(const std::map<DiscIO::Language, std::string>& strings) const;
|
LookupUsingConfigLanguage(const std::map<DiscIO::Language, std::string>& strings) const;
|
||||||
|
std::string GetExtension() const;
|
||||||
bool IsElfOrDol() const;
|
bool IsElfOrDol() const;
|
||||||
bool ReadXMLMetadata(const std::string& path);
|
bool ReadXMLMetadata(const std::string& path);
|
||||||
bool ReadPNGBanner(const std::string& path);
|
bool ReadPNGBanner(const std::string& path);
|
||||||
|
|
Loading…
Reference in New Issue