diff options
| author | JosJuice <josjuice@gmail.com> | 2015-12-17 19:00:41 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2016-02-08 15:26:25 +0100 |
| commit | 8a2e678ea745d228c94f66ba49596e3011fcda8d (patch) | |
| tree | bde5952a7260ce05e7548e61b5b4698490c727ec /Source | |
| parent | 8cad70238ccb1f8c9a77946dc3d9ef09798b7d04 (diff) | |
DolphinWX: Don't include skipped items in the compression count
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/GameListCtrl.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index bcf1c25ca5..7ca7968ab8 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -1099,20 +1099,26 @@ void CGameListCtrl::OnMultiDecompressISO(wxCommandEvent& /*event*/) void CGameListCtrl::CompressSelection(bool _compress) { - const std::vector<const GameListItem*> selected_items = GetAllSelectedISOs(); - - // If any Wii discs are going to be compressed, show the Wii compression warning once - if (_compress) + std::vector<const GameListItem*> items_to_compress; + bool wii_compression_warning_accepted = false; + for (const GameListItem* iso : GetAllSelectedISOs()) { - for (const GameListItem* iso : selected_items) + // Don't include items that we can't do anything with + if (iso->GetPlatform() != DiscIO::IVolume::GAMECUBE_DISC && iso->GetPlatform() != DiscIO::IVolume::WII_DISC) + continue; + if (iso->GetBlobType() != DiscIO::BlobType::PLAIN && iso->GetBlobType() != DiscIO::BlobType::GCZ) + continue; + + 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() && iso->GetPlatform() == DiscIO::IVolume::WII_DISC) { - if (!iso->IsCompressed() && iso->GetPlatform() == DiscIO::IVolume::WII_DISC) - { - if (WiiCompressWarning()) - break; - else - return; - } + if (WiiCompressWarning()) + wii_compression_warning_accepted = true; + else + return; } } @@ -1138,15 +1144,10 @@ void CGameListCtrl::CompressSelection(bool _compress) wxPD_SMOOTH ); - CompressionProgress progress(0, GetSelectedItemCount(), "", &progressDialog); + CompressionProgress progress(0, items_to_compress.size(), "", &progressDialog); - for (const GameListItem* iso : selected_items) + for (const GameListItem* iso : items_to_compress) { - if (iso->GetPlatform() != DiscIO::IVolume::GAMECUBE_DISC && iso->GetPlatform() != DiscIO::IVolume::WII_DISC) - continue; - if (iso->GetBlobType() != DiscIO::BlobType::PLAIN && iso->GetBlobType() != DiscIO::BlobType::GCZ) - continue; - if (!iso->IsCompressed() && _compress) { std::string FileName; |
