From a372a1d7820e8d82b91c3e411569a57e1d4f38d4 Mon Sep 17 00:00:00 2001
From: Connor McLaughlin <stenzek@gmail.com>
Date: Mon, 12 Oct 2020 00:40:06 +1000
Subject: [PATCH] GameList: Fix progress disappearing when scanning >1
 directory

---
 src/frontend-common/game_list.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/frontend-common/game_list.cpp b/src/frontend-common/game_list.cpp
index d6317f671..66829c5b1 100644
--- a/src/frontend-common/game_list.cpp
+++ b/src/frontend-common/game_list.cpp
@@ -696,10 +696,11 @@ void GameList::Refresh(bool invalidate_cache, bool invalidate_database, Progress
     progress->SetProgressRange(static_cast<u32>(m_search_directories.size()));
     progress->SetProgressValue(0);
 
-    for (DirectoryEntry& de : m_search_directories)
+    for (u32 i = 0; i < static_cast<u32>(m_search_directories.size()); i++)
     {
+      const DirectoryEntry& de = m_search_directories[i];
       ScanDirectory(de.path.c_str(), de.recursive, progress);
-      progress->IncrementProgressValue();
+      progress->SetProgressValue(i + 1);
     }
   }