From ee98aaaed137b0e060b74de7575abe4975ce15d8 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Wed, 22 Feb 2023 17:48:44 +0100 Subject: [PATCH] Add a method to return format in `AppItem` --- .../main/java/emu/skyline/data/DataItem.kt | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/emu/skyline/data/DataItem.kt b/app/src/main/java/emu/skyline/data/DataItem.kt index fdc4e6de..4fea8c97 100644 --- a/app/src/main/java/emu/skyline/data/DataItem.kt +++ b/app/src/main/java/emu/skyline/data/DataItem.kt @@ -49,19 +49,26 @@ data class AppItem(private val meta : AppEntry) : DataItem() { */ val uri get() = meta.uri + /** + * The format of the application + */ + val format get() = meta.format + val loaderResult get() = meta.loaderResult - fun loaderResultString(context : Context) = context.getString(when (meta.loaderResult) { - LoaderResult.Success -> R.string.metadata_missing + fun loaderResultString(context : Context) = context.getString( + when (meta.loaderResult) { + LoaderResult.Success -> R.string.metadata_missing - LoaderResult.ParsingError -> R.string.invalid_file + LoaderResult.ParsingError -> R.string.invalid_file - LoaderResult.MissingTitleKey -> R.string.missing_title_key + LoaderResult.MissingTitleKey -> R.string.missing_title_key - LoaderResult.MissingHeaderKey, - LoaderResult.MissingTitleKek, - LoaderResult.MissingKeyArea -> R.string.incomplete_prod_keys - }) + LoaderResult.MissingHeaderKey, + LoaderResult.MissingTitleKek, + LoaderResult.MissingKeyArea -> R.string.incomplete_prod_keys + } + ) /** * The name and author is used as the key