Don't show "extra" files from DirectoryBlobs in game list

For instance, we don't want to show TGC files that might be
inside the /files/ directory of a GameCube DirectoryBlob,
and we don't want to show the /sys/main.dol files for extra
partitions of Wii DirectoryBlobs.
This commit is contained in:
JosJuice
2017-06-11 14:45:42 +02:00
parent 1ea44f425d
commit 5fe3745750
5 changed files with 96 additions and 12 deletions

View File

@ -6,6 +6,7 @@
#include <QDirIterator>
#include <QFile>
#include "DiscIO/DirectoryBlob.h"
#include "DolphinQt2/GameList/GameTracker.h"
#include "DolphinQt2/Settings.h"
@ -137,3 +138,13 @@ void GameTracker::UpdateFile(const QString& file)
emit GameRemoved(file);
}
}
void GameLoader::LoadGame(const QString& path)
{
if (!DiscIO::ShouldHideFromGameList(path.toStdString()))
{
GameFile* game = new GameFile(path);
if (game->IsValid())
emit GameLoaded(QSharedPointer<GameFile>(game));
}
}

View File

@ -54,12 +54,7 @@ class GameLoader final : public QObject
Q_OBJECT
public:
void LoadGame(const QString& path)
{
GameFile* game = new GameFile(path);
if (game->IsValid())
emit GameLoaded(QSharedPointer<GameFile>(game));
}
void LoadGame(const QString& path);
signals:
void GameLoaded(QSharedPointer<GameFile> game);