[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:
parent
23ff31451f
commit
654b0dbfa8
|
@ -128,6 +128,8 @@ public final class DolphinEmulator<MainActivity> extends Activity
|
||||||
CopyAsset("setting-usa.txt", WiiDir + File.separator + "setting-usa.txt");
|
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);
|
UserPreferences.LoadDolphinConfigToPrefs(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +150,6 @@ public final class DolphinEmulator<MainActivity> extends Activity
|
||||||
String FileName = data.getStringExtra("Select");
|
String FileName = data.getStringExtra("Select");
|
||||||
GLview = new NativeGLSurfaceView(this);
|
GLview = new NativeGLSurfaceView(this);
|
||||||
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
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.SetDimensions((int)screenWidth, (int)screenHeight);
|
||||||
NativeLibrary.SetFilename(FileName);
|
NativeLibrary.SetFilename(FileName);
|
||||||
setContentView(GLview);
|
setContentView(GLview);
|
||||||
|
|
|
@ -132,18 +132,9 @@ public final class FolderBrowser extends Fragment
|
||||||
{
|
{
|
||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
|
|
||||||
// This makes sure that the container activity has implemented
|
// Cache the activity instance.
|
||||||
// the callback interface. If not, it throws an exception
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_activity = activity;
|
m_activity = activity;
|
||||||
}
|
}
|
||||||
catch (ClassCastException e)
|
|
||||||
{
|
|
||||||
throw new ClassCastException(activity.toString()
|
|
||||||
+ " must implement OnGameListZeroListener");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void FolderSelected()
|
private void FolderSelected()
|
||||||
|
|
|
@ -95,11 +95,12 @@ public final class GameListFragment extends Fragment
|
||||||
// so there should be no worries about accidentally removing a valid game.
|
// so there should be no worries about accidentally removing a valid game.
|
||||||
for (int i = 0; i < fls.size(); i++)
|
for (int i = 0; i < fls.size(); i++)
|
||||||
{
|
{
|
||||||
int indexNext = i+1;
|
for (int j = i+1; j < fls.size(); j++)
|
||||||
|
|
||||||
if (indexNext < fls.size() && fls.get(indexNext).getPath().contains(fls.get(i).getPath()))
|
|
||||||
{
|
{
|
||||||
fls.remove(indexNext);
|
if (fls.get(j).getPath().equals(fls.get(i).getPath()))
|
||||||
|
{
|
||||||
|
fls.remove(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue