summaryrefslogtreecommitdiff
path: root/Source/Android/src
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Android/src')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java
index 13f66c1c83..8464eaea9c 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListFragment.java
@@ -76,6 +76,21 @@ public final class GameListFragment extends Fragment
}
}
Collections.sort(fls);
+
+ // Remove any duplicate items from the list.
+ // We don't need to index these in the game list more than once.
+ //
+ // This works by comparing the paths of items in the file list for equality,
+ // so there should be no worries about accidentally removing a valid game.
+ for (int i = 0; i < fls.size(); i++)
+ {
+ int indexNext = i+1;
+
+ if (indexNext < fls.size() && fls.get(indexNext).getPath().contains(fls.get(i).getPath()))
+ {
+ fls.remove(indexNext);
+ }
+ }
mGameAdapter = new GameListAdapter(mMe, R.layout.gamelist_layout, fls);
mMainList.setAdapter(mGameAdapter);