diff --git a/Source/Core/DolphinQt2/GameList/GameListModel.cpp b/Source/Core/DolphinQt2/GameList/GameListModel.cpp index 7dd81e047d..7f26c87435 100644 --- a/Source/Core/DolphinQt2/GameList/GameListModel.cpp +++ b/Source/Core/DolphinQt2/GameList/GameListModel.cpp @@ -18,8 +18,7 @@ const QSize GAMECUBE_BANNER_SIZE(96, 32); GameListModel::GameListModel(QObject* parent) : QAbstractTableModel(parent) { connect(&m_tracker, &GameTracker::GameLoaded, this, &GameListModel::UpdateGame); - connect(&m_tracker, &GameTracker::GameRemoved, this, - [this](const QString& path) { RemoveGame(path.toStdString()); }); + connect(&m_tracker, &GameTracker::GameRemoved, this, &GameListModel::RemoveGame); connect(&Settings::Instance(), &Settings::PathAdded, &m_tracker, &GameTracker::AddDirectory); connect(&Settings::Instance(), &Settings::PathRemoved, &m_tracker, &GameTracker::RemoveDirectory); connect(&Settings::Instance(), &Settings::PathReloadRequested, &m_tracker, diff --git a/Source/Core/DolphinQt2/GameList/GameTracker.cpp b/Source/Core/DolphinQt2/GameList/GameTracker.cpp index b9c5d4f7a0..958236d227 100644 --- a/Source/Core/DolphinQt2/GameList/GameTracker.cpp +++ b/Source/Core/DolphinQt2/GameList/GameTracker.cpp @@ -90,9 +90,7 @@ void GameTracker::StartInternal() auto emit_game_loaded = [this](const std::shared_ptr& game) { emit GameLoaded(std::move(game)); }; - auto emit_game_removed = [this](const std::string& path) { - emit GameRemoved(QString::fromStdString(path)); - }; + auto emit_game_removed = [this](const std::string& path) { emit GameRemoved(path); }; std::lock_guard lk(m_mutex); @@ -159,7 +157,7 @@ void GameTracker::RemoveDirectoryInternal(const QString& dir) removePath(path); m_tracked_files.remove(path); if (m_started) - emit GameRemoved(path); + emit GameRemoved(path.toStdString()); } } } @@ -195,7 +193,7 @@ void GameTracker::UpdateDirectoryInternal(const QString& dir) { m_tracked_files.remove(missing); if (m_started) - GameRemoved(missing); + GameRemoved(missing.toStdString()); } } } @@ -205,7 +203,7 @@ void GameTracker::UpdateFileInternal(const QString& file) if (QFileInfo(file).exists()) { if (m_started) - GameRemoved(file); + GameRemoved(file.toStdString()); addPath(file); LoadGame(file); } @@ -213,7 +211,7 @@ void GameTracker::UpdateFileInternal(const QString& file) { m_tracked_files.remove(file); if (m_started) - emit GameRemoved(file); + emit GameRemoved(file.toStdString()); } } diff --git a/Source/Core/DolphinQt2/GameList/GameTracker.h b/Source/Core/DolphinQt2/GameList/GameTracker.h index 63d8232dce..cbe6c63cba 100644 --- a/Source/Core/DolphinQt2/GameList/GameTracker.h +++ b/Source/Core/DolphinQt2/GameList/GameTracker.h @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -39,7 +40,7 @@ public: signals: void GameLoaded(std::shared_ptr game); - void GameRemoved(const QString& path); + void GameRemoved(const std::string& path); private: void LoadCache(); @@ -80,3 +81,4 @@ private: }; Q_DECLARE_METATYPE(std::shared_ptr) +Q_DECLARE_METATYPE(std::string)