Make file plugin config parameter non-optional, remove unused field

This commit is contained in:
MM20
2023-12-15 13:54:57 +01:00
parent c3acebe072
commit f327906a3e
2 changed files with 1 additions and 7 deletions
@@ -4,10 +4,6 @@ import android.os.Bundle
import de.mm20.launcher2.plugin.config.StorageStrategy
data class SearchPluginConfig(
/**
* Icon resource to indicate that a result is from this provider
*/
val providerIconRes: Int? = null,
/**
* Strategy to store items from this provider in the launcher database
* @see [StorageStrategy]
@@ -16,7 +12,6 @@ data class SearchPluginConfig(
) {
fun toBundle(): Bundle {
return Bundle().apply {
putInt("providerIconRes", providerIconRes ?: 0)
putString("storageStrategy", storageStrategy.name)
}
}
@@ -24,7 +19,6 @@ data class SearchPluginConfig(
companion object {
operator fun invoke(bundle: Bundle): SearchPluginConfig? {
return SearchPluginConfig(
providerIconRes = bundle.getInt("providerIconRes", 0).takeIf { it != 0 },
storageStrategy = StorageStrategy.valueOfOrElse(
bundle.getString(
"storageStrategy",