diff options
| author | JosJuice <josjuice@gmail.com> | 2020-06-27 12:35:18 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2020-09-16 18:48:25 +0200 |
| commit | f01ccfdb824d37dd9bee2eb150a7721ea19b6837 (patch) | |
| tree | 5c931dea76a4e17da2ee528b447fad6d81bd7d19 /Source/Core | |
| parent | 23ea47d4dfb8ea4ac2b33aa8c5650110dbb0aa89 (diff) | |
Android: Only allow conversion when appropriate
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/GameList/GameList.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/UICommon/GameFile.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/UICommon/GameFile.h | 1 |
3 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index 956bc704dc..11cbadb2d3 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -267,9 +267,8 @@ void GameList::ShowContextMenu(const QPoint&) { const auto selected_games = GetSelectedGames(); - if (std::all_of(selected_games.begin(), selected_games.end(), [](const auto& game) { - return DiscIO::IsDisc(game->GetPlatform()) && game->IsVolumeSizeAccurate(); - })) + if (std::all_of(selected_games.begin(), selected_games.end(), + [](const auto& game) { return game->ShouldAllowConversion(); })) { menu->addAction(tr("Convert Selected Files..."), this, &GameList::ConvertFile); menu->addSeparator(); @@ -301,7 +300,7 @@ void GameList::ShowContextMenu(const QPoint&) { menu->addAction(tr("Set as &Default ISO"), this, &GameList::SetDefaultISO); - if (game->IsVolumeSizeAccurate()) + if (game->ShouldAllowConversion()) menu->addAction(tr("Convert File..."), this, &GameList::ConvertFile); QAction* change_disc = menu->addAction(tr("Change &Disc"), this, &GameList::ChangeDisc); diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index 30641d58e5..ff0fa84798 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -672,6 +672,11 @@ std::string GameFile::GetFileFormatName() const } } +bool GameFile::ShouldAllowConversion() const +{ + return DiscIO::IsDisc(m_platform) && m_volume_size_is_accurate; +} + const GameBanner& GameFile::GetBannerImage() const { return m_custom_banner.empty() ? m_volume_banner : m_custom_banner; diff --git a/Source/Core/UICommon/GameFile.h b/Source/Core/UICommon/GameFile.h index 9366b33f2e..3aa693507f 100644 --- a/Source/Core/UICommon/GameFile.h +++ b/Source/Core/UICommon/GameFile.h @@ -101,6 +101,7 @@ public: const std::string& GetCompressionMethod() const { return m_compression_method; } bool ShouldShowFileFormatDetails() const; std::string GetFileFormatName() const; + bool ShouldAllowConversion() const; const std::string& GetApploaderDate() const { return m_apploader_date; } u64 GetFileSize() const { return m_file_size; } u64 GetVolumeSize() const { return m_volume_size; } |
