Make file plugin config parameter non-optional, remove unused field
This commit is contained in:
parent
c3acebe072
commit
f327906a3e
@ -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",
|
||||
|
||||
@ -7,7 +7,7 @@ import de.mm20.launcher2.plugin.contracts.FilePluginContract
|
||||
import de.mm20.launcher2.sdk.base.SearchPluginProvider
|
||||
|
||||
abstract class FileProvider(
|
||||
config: SearchPluginConfig = SearchPluginConfig(),
|
||||
config: SearchPluginConfig,
|
||||
) : SearchPluginProvider<File>(config) {
|
||||
abstract override suspend fun search(query: String): List<File>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user