From acd6cb79a4418ac0f0d5c6e70f210363aafa62f4 Mon Sep 17 00:00:00 2001 From: comex Date: Sun, 21 Jun 2015 16:03:32 -0400 Subject: [PATCH] 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)