From 3c3d0fa6f58a3d7f28f1b170571107526a490974 Mon Sep 17 00:00:00 2001 From: Mike Harris Date: Wed, 27 Sep 2017 11:16:48 -0700 Subject: [PATCH] Remove 'all' as a Platform enum. This will remove the 'all games' row on the TV view. --- .../dolphinemu/adapters/GameRowPresenter.java | 3 ++- .../dolphinemu/dolphinemu/model/GameDatabase.java | 12 ++---------- .../dolphinemu/dolphinemu/ui/platform/Platform.java | 3 +-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java index 5086e95a2d..b6b173d4c3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java @@ -70,9 +70,10 @@ public final class GameRowPresenter extends Presenter backgroundId = R.drawable.tv_card_background_wii; break; case WIIWARE: - default: // This shouldn't happen, but set the default to WiiWare colors. backgroundId = R.drawable.tv_card_background_wiiware; break; + default: + throw new AssertionError("Not reachable."); } Context context = holder.cardParent.getContext(); Drawable background = ContextCompat.getDrawable(context, backgroundId); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java index 2ab05172e2..1a4f872330 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java @@ -262,21 +262,13 @@ public final class GameDatabase extends SQLiteOpenHelper { Log.info("[GameDatabase] Reading games list..."); - - // Only add a WHERE clause if we have a specific platform - String whereClause = null; - String[] whereArgs = null; - if (platform != Platform.ALL) - { - whereClause = KEY_GAME_PLATFORM + " = ?"; - whereArgs = new String[]{Integer.toString(platform.toInt())}; - } + String[] whereArgs = new String[]{Integer.toString(platform.toInt())}; SQLiteDatabase database = getReadableDatabase(); Cursor resultCursor = database.query( TABLE_NAME_GAMES, null, - whereClause, + KEY_GAME_PLATFORM + " = ?", whereArgs, null, null, diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/Platform.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/Platform.java index 7db7b61bbc..b161a1cde4 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/Platform.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/Platform.java @@ -5,8 +5,7 @@ public enum Platform { GAMECUBE(0, "GameCube Games"), WII(1, "Wii Games"), - WIIWARE(2, "WiiWare Games"), - ALL(3, "All Games"); + WIIWARE(2, "WiiWare Games"); private final int value; private final String headerName;