Remove legacy code

This commit is contained in:
Julian Raufelder 2022-04-13 16:27:48 +02:00
parent 46bb53446c
commit e373cabc96
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -54,7 +54,6 @@ class CloudConnectionListPresenter @Inject constructor( //
) : Presenter<CloudConnectionListView>(exceptionMappings) {
private val selectedCloudType = AtomicReference<CloudTypeModel>()
private var defaultLocalStorageCloud: LocalStorageCloud? = null
fun setSelectedCloudType(selectedCloudType: CloudTypeModel) {
this.selectedCloudType.set(selectedCloudType)
}
@ -64,17 +63,7 @@ class CloudConnectionListPresenter @Inject constructor( //
.withCloudType(CloudTypeModel.valueOf(selectedCloudType.get())) //
.run(object : DefaultResultHandler<List<Cloud>>() {
override fun onSuccess(clouds: List<Cloud>) {
val cloudModels: MutableList<CloudModel> = ArrayList()
clouds.forEach { cloud ->
if (CloudTypeModel.LOCAL == selectedCloudType.get()) {
if ((cloud as LocalStorageCloud).rootUri() == null) {
defaultLocalStorageCloud = cloud
return@forEach
}
}
cloudModels.add(cloudModelMapper.toModel(cloud))
}
view?.showCloudModels(cloudModels)
view?.showCloudModels(clouds.map { cloud -> cloudModelMapper.toModel(cloud) })
}
})
}