refactor: Assorted code inspection cleanups (#985)
Code inspection found some mechanical code cleanups.
This commit is contained in:
parent
ea635d654e
commit
668c073822
|
@ -58,9 +58,7 @@ data class TabViewData(
|
||||||
|
|
||||||
other as TabViewData
|
other as TabViewData
|
||||||
|
|
||||||
if (timeline != other.timeline) return false
|
return timeline == other.timeline
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode() = timeline.hashCode()
|
override fun hashCode() = timeline.hashCode()
|
||||||
|
|
|
@ -122,10 +122,10 @@ abstract class SFragment<T : IStatusViewData> : Fragment(), StatusActionListener
|
||||||
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||||
serverRepository.flow.collect { result ->
|
serverRepository.flow.collect { result ->
|
||||||
result.onSuccess {
|
result.onSuccess {
|
||||||
serverCanTranslate = it?.can(
|
serverCanTranslate = it.can(
|
||||||
operation = ORG_JOINMASTODON_STATUSES_TRANSLATE,
|
operation = ORG_JOINMASTODON_STATUSES_TRANSLATE,
|
||||||
constraint = ">=1.0".toConstraint(),
|
constraint = ">=1.0".toConstraint(),
|
||||||
) ?: false
|
)
|
||||||
}
|
}
|
||||||
result.onFailure {
|
result.onFailure {
|
||||||
val msg = getString(
|
val msg = getString(
|
||||||
|
|
|
@ -163,7 +163,7 @@ class StatusDisplayOptionsRepository @Inject constructor(
|
||||||
result.onSuccess { server ->
|
result.onSuccess { server ->
|
||||||
_flow.update {
|
_flow.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
canTranslate = server?.can(ORG_JOINMASTODON_STATUSES_TRANSLATE, ">=1.0".toConstraint()) ?: false,
|
canTranslate = server.can(ORG_JOINMASTODON_STATUSES_TRANSLATE, ">=1.0".toConstraint()),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ data class ContentFilter(
|
||||||
val filterAction: FilterAction,
|
val filterAction: FilterAction,
|
||||||
val keywords: List<FilterKeyword> = emptyList(),
|
val keywords: List<FilterKeyword> = emptyList(),
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
companion object {}
|
companion object
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A filter choice, either content filter or account filter. */
|
/** A filter choice, either content filter or account filter. */
|
||||||
|
|
|
@ -35,7 +35,6 @@ import org.gradle.api.tasks.Input
|
||||||
import org.gradle.api.tasks.InputFiles
|
import org.gradle.api.tasks.InputFiles
|
||||||
import org.gradle.api.tasks.OutputDirectory
|
import org.gradle.api.tasks.OutputDirectory
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
import org.gradle.configurationcache.extensions.capitalized
|
|
||||||
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
|
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
|
||||||
import org.intellij.markdown.html.HtmlGenerator
|
import org.intellij.markdown.html.HtmlGenerator
|
||||||
import org.intellij.markdown.parser.MarkdownParser
|
import org.intellij.markdown.parser.MarkdownParser
|
||||||
|
@ -136,7 +135,7 @@ class Markdown2ResourcePlugin : Plugin<Project> {
|
||||||
appExtension.libraryVariants.all { variant ->
|
appExtension.libraryVariants.all { variant ->
|
||||||
val outputDir =
|
val outputDir =
|
||||||
target.layout.buildDirectory.dir("generated/source/${variant.name}")
|
target.layout.buildDirectory.dir("generated/source/${variant.name}")
|
||||||
val taskName = "markdown2resource${variant.name.capitalized()}"
|
val taskName = "markdown2resource${variant.name.toString().replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }}"
|
||||||
|
|
||||||
extension.packageName.convention(variant.mergeResourcesProvider.get().namespace)
|
extension.packageName.convention(variant.mergeResourcesProvider.get().namespace)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* see <http://www.gnu.org/licenses>.
|
* see <http://www.gnu.org/licenses>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin.jvm)
|
alias(libs.plugins.kotlin.jvm)
|
||||||
|
@ -25,9 +25,9 @@ subprojects {
|
||||||
apply(plugin = "kotlin")
|
apply(plugin = "kotlin")
|
||||||
apply(plugin = "application")
|
apply(plugin = "application")
|
||||||
|
|
||||||
tasks.withType<KotlinCompile>().configureEach {
|
tasks.named<KotlinCompilationTask<*>>("compileKotlin").configure {
|
||||||
kotlinOptions {
|
compilerOptions {
|
||||||
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
|
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue