From 8013e04d2c7cad8ab89dfd8245b36b1c8b3d838a Mon Sep 17 00:00:00 2001
From: Leon Styhre <leon@leonstyhre.com>
Date: Mon, 5 Dec 2022 21:08:20 +0100
Subject: [PATCH] Fixed an issue where folders in mixed gamelists were not
 always sorted correctly.

---
 es-app/src/FileData.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp
index 7647a7001..80bcf5a08 100644
--- a/es-app/src/FileData.cpp
+++ b/es-app/src/FileData.cpp
@@ -538,7 +538,7 @@ void FileData::sort(ComparisonFunction& comparator,
                              getSortTypeFromString("filename, ascending").comparisonFunction);
         }
 
-        if (foldersOnTop && mOnlyFolders)
+        if (foldersOnTop)
             std::stable_sort(mChildrenFolders.begin(), mChildrenFolders.end(), comparator);
 
         std::stable_sort(mChildrenOthers.begin(), mChildrenOthers.end(), comparator);
@@ -685,7 +685,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
     }
 
     // Sort favorite games and the other games separately.
-    if (foldersOnTop && mOnlyFolders) {
+    if (foldersOnTop) {
         std::stable_sort(mChildrenFavoritesFolders.begin(), mChildrenFavoritesFolders.end(),
                          comparator);
         std::stable_sort(mChildrenFolders.begin(), mChildrenFolders.end(), comparator);