From 8793f7c325f7164f0cfe3095f697ef9bf5473344 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 13 Jun 2015 16:37:37 +0200 Subject: [PATCH] DolphinQt: Store GameFile banner as empty if missing --- Source/Core/DolphinQt/GameList/GameFile.cpp | 15 +++------------ Source/Core/DolphinQt/GameList/GameFile.h | 10 +++++++++- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Source/Core/DolphinQt/GameList/GameFile.cpp b/Source/Core/DolphinQt/GameList/GameFile.cpp index a89b5ce9ad..df363410f3 100644 --- a/Source/Core/DolphinQt/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt/GameList/GameFile.cpp @@ -22,7 +22,6 @@ #include "DiscIO/Filesystem.h" #include "DolphinQt/GameList/GameFile.h" -#include "DolphinQt/Utils/Resources.h" #include "DolphinQt/Utils/Utils.h" static const u32 CACHE_REVISION = 0x00A; @@ -72,12 +71,9 @@ static QString GetLanguageString(DiscIO::IVolume::ELanguage language, QMap> 0)); } + m_valid = true; + if (!banner.isNull()) { - hasBanner = true; m_banner = QPixmap::fromImage(banner); - } - - m_valid = true; - if (hasBanner) SaveToCache(); + } } } @@ -138,9 +132,6 @@ GameFile::GameFile(const QString& fileName) ini.GetIfExists("EmuState", "EmulationIssues", &issues_temp); m_issues = QString::fromStdString(issues_temp); } - - if (!hasBanner) - m_banner = Resources::GetPixmap(Resources::BANNER_MISSING); } bool GameFile::LoadFromCache() diff --git a/Source/Core/DolphinQt/GameList/GameFile.h b/Source/Core/DolphinQt/GameList/GameFile.h index 00e79c7720..4c603e2236 100644 --- a/Source/Core/DolphinQt/GameList/GameFile.h +++ b/Source/Core/DolphinQt/GameList/GameFile.h @@ -13,6 +13,8 @@ #include "DiscIO/Volume.h" #include "DiscIO/VolumeCreator.h" +#include "DolphinQt/Utils/Resources.h" + class GameFile final { public: @@ -39,7 +41,13 @@ public: u64 GetVolumeSize() const { return m_volume_size; } // 0 is the first disc, 1 is the second disc u8 GetDiscNumber() const { return m_disc_number; } - const QPixmap GetBitmap() const { return m_banner; } + const QPixmap GetBitmap() const + { + if (m_banner.isNull()) + return Resources::GetPixmap(Resources::BANNER_MISSING); + + return m_banner; + } private: QString m_file_name;