From 384a1b4e3b63aec988260fdb23e1c48429ee97e5 Mon Sep 17 00:00:00 2001 From: comex Date: Sun, 21 Jun 2015 16:03:32 -0400 Subject: [PATCH 1/3] Fix DoFileSearch returning the passed-in directories themselves. Fixes https://code.google.com/p/dolphin-emu/issues/detail?id=8697&can=3 --- Source/Core/Common/FileSearch.cpp | 4 +++- Source/Core/DolphinQt/GameList/GameTracker.cpp | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index 13e99fe88a..b5395cf21c 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -28,7 +28,8 @@ static std::vector FileSearchWithTest(const std::vector DoFileSearch(const std::vector& globs, con }); } +// Result includes the passed directories themselves as well as their subdirectories. std::vector FindSubdirectories(const std::vector& directories, bool recursive) { return FileSearchWithTest(directories, true, [&](const File::FSTEntry& entry) { diff --git a/Source/Core/DolphinQt/GameList/GameTracker.cpp b/Source/Core/DolphinQt/GameList/GameTracker.cpp index 8bb41c39aa..7213024fe1 100644 --- a/Source/Core/DolphinQt/GameList/GameTracker.cpp +++ b/Source/Core/DolphinQt/GameList/GameTracker.cpp @@ -80,16 +80,13 @@ void DGameTracker::ScanForGames() delete m_watcher; m_watcher = new QFileSystemWatcher(this); + for (std::string dir : SConfig::GetInstance().m_ISOFolder) + m_watcher->addPath(QString::fromStdString(dir)); if (SConfig::GetInstance().m_RecursiveISOFolder) { for (std::string dir : FindSubdirectories(SConfig::GetInstance().m_ISOFolder, /*recursive*/ true)) m_watcher->addPath(QString::fromStdString(dir)); } - else - { - for (std::string dir : SConfig::GetInstance().m_ISOFolder) - m_watcher->addPath(QString::fromStdString(dir)); - } std::vector exts; if (SConfig::GetInstance().m_ListGC) From 69b7296fc257cd856a195122b41a23848c6b85c2 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 21 Jun 2015 14:22:07 +0200 Subject: [PATCH 2/3] WiimoteReal: Make sure that Wiimote thread isn't already running before starting it. This fixes a crash when switching a Wiimote's internal slot or type in the Dolphin config. --- Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 388789076c..7bbd3d75bd 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -485,9 +485,12 @@ void WiimoteScanner::ThreadFunc() bool Wiimote::Connect() { - m_thread_ready.store(false); - StartThread(); - WaitReady(); + if (!m_run_thread.load()) + { + m_thread_ready.store(false); + StartThread(); + WaitReady(); + } return IsConnected(); } From 66136fc710a2d583d2fef905d667e176c43e6080 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 28 Jun 2015 10:39:24 +0200 Subject: [PATCH 3/3] Fix more game list name encoding errors caused by 4.0-6419 (d7900b4) 4.0-6442 (a26cf63) didn't fix names read from INIs or titles.txt. --- Source/Core/DolphinWX/GameListCtrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 34f50ef4d5..0c847387ba 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -403,7 +403,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index) if (line.substr(0,rISOFile.GetUniqueID().size()) == rISOFile.GetUniqueID()) { - name = line.substr(rISOFile.GetUniqueID().size() + 3); + name = StrToWxStr(line.substr(rISOFile.GetUniqueID().size() + 3)); break; } } @@ -413,7 +413,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index) std::string title; IniFile gameini = SCoreStartupParameter::LoadGameIni(rISOFile.GetUniqueID(), rISOFile.GetRevision()); if (gameini.GetIfExists("EmuState", "Title", &title)) - name = title; + name = StrToWxStr(title); int disc_number = rISOFile.GetDiscNumber() + 1; if (disc_number > 1 && name.Lower().find(wxString::Format("disc %i", disc_number)) == std::string::npos