Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
lioncash committed Aug 23, 2013
1 parent 23ff314 commit 654b0db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
Expand Up @@ -128,6 +128,8 @@ public void onCreate(Bundle savedInstanceState)
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);
}
}
Expand All @@ -148,7 +150,6 @@ public void onActivityResult(int requestCode, int resultCode, Intent data)
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);
Expand Down
Expand Up @@ -132,17 +132,8 @@ public void onAttach(Activity activity)
{
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;
}


Expand Down
Expand Up @@ -95,11 +95,12 @@ private void Fill()
// 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);
}
}
}

Expand Down

0 comments on commit 654b0db

Please sign in to comment.