mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Don't store custom names from TitleDatabase in GameFileCache
This saves us from having to update the GameFileCache when the TitleDatabase changes (for instance when the user changes language).
This commit is contained in:
@ -80,7 +80,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
|
||||
case COL_TITLE:
|
||||
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
|
||||
{
|
||||
QString name = QString::fromStdString(game.GetName());
|
||||
QString name = QString::fromStdString(game.GetName(m_title_database));
|
||||
const int disc_nr = game.GetDiscNumber() + 1;
|
||||
if (disc_nr > 1)
|
||||
{
|
||||
@ -161,8 +161,10 @@ bool GameListModel::ShouldDisplayGameListItem(int index) const
|
||||
const UICommon::GameFile& game = *m_games[index];
|
||||
|
||||
if (!m_term.isEmpty() &&
|
||||
!QString::fromStdString(game.GetName()).contains(m_term, Qt::CaseInsensitive))
|
||||
!QString::fromStdString(game.GetName(m_title_database)).contains(m_term, Qt::CaseInsensitive))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool show_platform = [&game] {
|
||||
switch (game.GetPlatform())
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include <QAbstractTableModel>
|
||||
#include <QString>
|
||||
|
||||
#include "Core/TitleDatabase.h"
|
||||
|
||||
#include "DolphinQt2/GameList/GameTracker.h"
|
||||
|
||||
#include "UICommon/GameFile.h"
|
||||
@ -63,5 +65,6 @@ private:
|
||||
|
||||
GameTracker m_tracker;
|
||||
QList<std::shared_ptr<const UICommon::GameFile>> m_games;
|
||||
Core::TitleDatabase m_title_database;
|
||||
QString m_term;
|
||||
};
|
||||
|
@ -105,7 +105,7 @@ void GameTracker::StartInternal()
|
||||
m_initial_games_emitted_event.Wait();
|
||||
|
||||
bool cache_updated = m_cache.Update(paths, emit_game_loaded, emit_game_removed);
|
||||
cache_updated |= m_cache.UpdateAdditionalMetadata(m_title_database, emit_game_updated);
|
||||
cache_updated |= m_cache.UpdateAdditionalMetadata(emit_game_updated);
|
||||
if (cache_updated)
|
||||
m_cache.Save();
|
||||
}
|
||||
@ -256,7 +256,7 @@ void GameTracker::LoadGame(const QString& path)
|
||||
if (!DiscIO::ShouldHideFromGameList(converted_path))
|
||||
{
|
||||
bool cache_changed = false;
|
||||
auto game = m_cache.AddOrGet(converted_path, &cache_changed, m_title_database);
|
||||
auto game = m_cache.AddOrGet(converted_path, &cache_changed);
|
||||
if (game)
|
||||
emit GameLoaded(std::move(game));
|
||||
if (cache_changed)
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
#include "Common/Event.h"
|
||||
#include "Common/WorkQueueThread.h"
|
||||
#include "Core/TitleDatabase.h"
|
||||
#include "UICommon/GameFile.h"
|
||||
#include "UICommon/GameFileCache.h"
|
||||
|
||||
@ -75,7 +74,6 @@ private:
|
||||
QMap<QString, QSet<QString>> m_tracked_files;
|
||||
Common::WorkQueueThread<Command> m_load_thread;
|
||||
UICommon::GameFileCache m_cache;
|
||||
Core::TitleDatabase m_title_database;
|
||||
Common::Event m_cache_loaded_event;
|
||||
Common::Event m_initial_games_emitted_event;
|
||||
bool m_initial_games_emitted = false;
|
||||
|
Reference in New Issue
Block a user