diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-06-08 19:35:17 -0400 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2015-06-08 19:35:17 -0400 |
| commit | 2282be3265c8b9b036c2ef598b519f43a563fffc (patch) | |
| tree | b49baad202d9a9fb1fcb81488fd1f9fdfd95f5b5 /Source/Android/app/src | |
| parent | 58f9b05e7e06835bce5b3a78b8c5796044378d0f (diff) | |
| parent | 1f07473f1fdb643ced2a2acde08a901cb52ab7ff (diff) | |
Merge pull request #2573 from sigmabeta/android-show-filenames
Android: Show filenames for games with an empty title.
Diffstat (limited to 'Source/Android/app/src')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameDatabase.java | 10 |
1 files changed, 9 insertions, 1 deletions
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 3d597b7ac3..4c2bffed0d 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 @@ -152,8 +152,16 @@ public final class GameDatabase extends SQLiteOpenHelper // Check that the file has an extension we care about before trying to read out of it. if (allowedExtensions.contains(fileExtension)) { + String name = NativeLibrary.GetTitle(filePath); + + // If the game's title field is empty, use the filename. + if (name.isEmpty()) + { + name = filePath.substring(filePath.lastIndexOf("/") + 1); + } + ContentValues game = Game.asContentValues(NativeLibrary.GetPlatform(filePath), - NativeLibrary.GetTitle(filePath), + name, NativeLibrary.GetDescription(filePath).replace("\n", " "), NativeLibrary.GetCountry(filePath), filePath, |
