mirror of
https://github.com/obhq/obliteration.git
synced 2024-06-12 09:37:15 -04:00
Add fallback icon0 (#827)
This commit is contained in:
parent
2c438c3a4b
commit
ad791adbe9
|
@ -1,5 +1,6 @@
|
|||
#include "game_models.hpp"
|
||||
#include "path.hpp"
|
||||
#include <QFile>
|
||||
|
||||
Game::Game(const QString &id, const QString &name, const QString &directory) :
|
||||
m_id(id),
|
||||
|
@ -18,8 +19,14 @@ QPixmap Game::icon() const
|
|||
auto dir = joinPath(m_directory, "sce_sys");
|
||||
auto path = joinPath(dir.c_str(), "icon0.png");
|
||||
|
||||
// Construct icon object.
|
||||
QPixmap icon(path.c_str());
|
||||
QPixmap icon;
|
||||
|
||||
if (QFile::exists(path.c_str())) {
|
||||
icon.load(path.c_str());
|
||||
} else {
|
||||
// Load fallback icon if icon0 doesn't exist.
|
||||
icon.load(":/resources/fallbackicon0.png");
|
||||
}
|
||||
|
||||
// For games with large icon sizes.
|
||||
if (icon.width() != 512 || icon.height() != 512) {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<file>resources/lightmode/cog-outline.svg</file>
|
||||
<file>resources/lightmode/folder-open-outline.svg</file>
|
||||
<file>resources/lightmode/view-comfy.svg</file>
|
||||
<file>resources/fallbackicon0.png</file>
|
||||
<file>resources/obliteration-icon.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
BIN
src/resources/fallbackicon0.png
Normal file
BIN
src/resources/fallbackicon0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
Loading…
Reference in a new issue