From 976ee893e2fb317d092367ee9398212634036c2f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 3 Jul 2023 16:58:43 +0200 Subject: [PATCH] Remove dead code. --- .../preferences/impl/about/AboutEvents.kt | 21 ------------------- .../preferences/impl/about/AboutPresenter.kt | 7 ------- .../preferences/impl/about/AboutState.kt | 2 -- .../impl/about/AboutStateProvider.kt | 1 - .../impl/analytics/AnalyticsSettingsEvents.kt | 21 ------------------- .../analytics/AnalyticsSettingsPresenter.kt | 7 ------- .../impl/analytics/AnalyticsSettingsState.kt | 1 - .../AnalyticsSettingsStateProvider.kt | 1 - 8 files changed, 61 deletions(-) delete mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt delete mode 100644 features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt deleted file mode 100644 index fd27e3f682..0000000000 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutEvents.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.element.android.features.preferences.impl.about - -sealed interface AboutEvents { - object MyEvent : AboutEvents -} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt index ce2439d8a6..556c62ec73 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutPresenter.kt @@ -25,15 +25,8 @@ class AboutPresenter @Inject constructor() : Presenter { @Composable override fun present(): AboutState { - fun handleEvents(event: AboutEvents) { - when (event) { - AboutEvents.MyEvent -> Unit - } - } - return AboutState( elementLegals = getAllLegals(), - eventSink = ::handleEvents ) } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt index 5a1a123b11..cd361bd4b0 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt @@ -16,9 +16,7 @@ package io.element.android.features.preferences.impl.about -// TODO add your ui models. Remove the eventSink if you don't have events. // Do not use default value, so no member get forgotten in the presenters. data class AboutState( val elementLegals: List, - val eventSink: (AboutEvents) -> Unit ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt index 6f195b71d7..5775cbe48c 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt @@ -27,5 +27,4 @@ open class AboutStateProvider : PreviewParameterProvider { fun aAboutState() = AboutState( elementLegals = getAllLegals(), - eventSink = {} ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt deleted file mode 100644 index 86b2db16d9..0000000000 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsEvents.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.element.android.features.preferences.impl.analytics - -sealed interface AnalyticsSettingsEvents { - object MyEvent : AnalyticsSettingsEvents -} diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt index 976193db74..1ef344403d 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsPresenter.kt @@ -29,15 +29,8 @@ class AnalyticsSettingsPresenter @Inject constructor( override fun present(): AnalyticsSettingsState { val analyticsState = analyticsPresenter.present() - fun handleEvents(event: AnalyticsSettingsEvents) { - when (event) { - AnalyticsSettingsEvents.MyEvent -> Unit - } - } - return AnalyticsSettingsState( analyticsState = analyticsState, - eventSink = ::handleEvents ) } } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt index b5a38fb23c..00fb8443c5 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsState.kt @@ -21,5 +21,4 @@ import io.element.android.features.analytics.api.preferences.AnalyticsPreference // Do not use default value, so no member get forgotten in the presenters. data class AnalyticsSettingsState( val analyticsState: AnalyticsPreferencesState, - val eventSink: (AnalyticsSettingsEvents) -> Unit ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt index f1eb2b6c0f..16ad2394ff 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/analytics/AnalyticsSettingsStateProvider.kt @@ -28,5 +28,4 @@ open class AnalyticsSettingsStateProvider : PreviewParameterProvider