From a7e11db4bfa33b5e3f6d43022a9c3f87d7052deb Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 20 Feb 2017 16:08:07 +0100 Subject: [PATCH] DolphinWX: Remove usage of IsCompressed() in compression code What we actually care about is whether it's a GCZ file, not whether it's compressed. (This commit doesn't change the behavior, since the beginning of CompressSelection discards items that aren't BlobType::GCZ or BlobType::PLAIN.) --- Source/Core/DolphinWX/GameListCtrl.cpp | 7 ++++--- Source/Core/DolphinWX/ISOFile.cpp | 6 ------ Source/Core/DolphinWX/ISOFile.h | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 14c262e39b..a6ea42048f 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -1215,7 +1215,8 @@ void CGameListCtrl::CompressSelection(bool _compress) items_to_compress.push_back(iso); // Show the Wii compression warning if it's relevant and it hasn't been shown already - if (!wii_compression_warning_accepted && _compress && !iso->IsCompressed() && + if (!wii_compression_warning_accepted && _compress && + iso->GetBlobType() != DiscIO::BlobType::GCZ && iso->GetPlatform() == DiscIO::Platform::WII_DISC) { if (WiiCompressWarning()) @@ -1246,7 +1247,7 @@ void CGameListCtrl::CompressSelection(bool _compress) for (const GameListItem* iso : items_to_compress) { - if (!iso->IsCompressed() && _compress) + if (iso->GetBlobType() != DiscIO::BlobType::GCZ && _compress) { std::string FileName; SplitPath(iso->GetFileName(), nullptr, &FileName, nullptr); @@ -1268,7 +1269,7 @@ void CGameListCtrl::CompressSelection(bool _compress) (iso->GetPlatform() == DiscIO::Platform::WII_DISC) ? 1 : 0, 16384, &MultiCompressCB, &progress); } - else if (iso->IsCompressed() && !_compress) + else if (iso->GetBlobType() == DiscIO::BlobType::GCZ && !_compress) { std::string FileName; SplitPath(iso->GetFileName(), nullptr, &FileName, nullptr); diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 5a46458d81..0962f17893 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -386,9 +386,3 @@ const std::string GameListItem::GetWiiFSPath() const return ret; } - -bool GameListItem::IsCompressed() const -{ - return m_blob_type == DiscIO::BlobType::GCZ || m_blob_type == DiscIO::BlobType::CISO || - m_blob_type == DiscIO::BlobType::WBFS; -} diff --git a/Source/Core/DolphinWX/ISOFile.h b/Source/Core/DolphinWX/ISOFile.h index d793860759..f12b710483 100644 --- a/Source/Core/DolphinWX/ISOFile.h +++ b/Source/Core/DolphinWX/ISOFile.h @@ -53,7 +53,6 @@ public: DiscIO::BlobType GetBlobType() const { return m_blob_type; } const std::string& GetIssues() const { return m_issues; } int GetEmuState() const { return m_emu_state; } - bool IsCompressed() const; u64 GetFileSize() const { return m_FileSize; } u64 GetVolumeSize() const { return m_VolumeSize; } // 0 is the first disc, 1 is the second disc