[Android] Fix the removal of duplicate items from the gamelist.

This should have initially been a nested loop since it now guarantees every item in the list is checked.

Also, removed some unused code and documented some things.
This commit is contained in:
Lioncash 2013-08-23 09:43:55 -04:00
parent 23ff31451f
commit 654b0dbfa8
3 changed files with 9 additions and 16 deletions

View File

@ -128,6 +128,8 @@ public final class DolphinEmulator<MainActivity> extends Activity
CopyAsset("setting-usa.txt", WiiDir + File.separator + "setting-usa.txt");
}
// Load the configuration keys set in the Dolphin ini and gfx ini files
// into the application's shared preferences.
UserPreferences.LoadDolphinConfigToPrefs(this);
}
}
@ -148,7 +150,6 @@ public final class DolphinEmulator<MainActivity> extends Activity
String FileName = data.getStringExtra("Select");
GLview = new NativeGLSurfaceView(this);
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
String backend = NativeLibrary.GetConfig("Dolphin.ini", "Core", "GFXBackend", "Software Renderer");
NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
NativeLibrary.SetFilename(FileName);
setContentView(GLview);

View File

@ -132,17 +132,8 @@ public final class FolderBrowser extends Fragment
{
super.onAttach(activity);
// This makes sure that the container activity has implemented
// the callback interface. If not, it throws an exception
try
{
m_activity = activity;
}
catch (ClassCastException e)
{
throw new ClassCastException(activity.toString()
+ " must implement OnGameListZeroListener");
}
// Cache the activity instance.
m_activity = activity;
}

View File

@ -95,11 +95,12 @@ public final class GameListFragment extends Fragment
// 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()))
for (int j = i+1; j < fls.size(); j++)
{
fls.remove(indexNext);
if (fls.get(j).getPath().equals(fls.get(i).getPath()))
{
fls.remove(j);
}
}
}