diff options
author | pacien | 2020-09-08 20:45:39 +0200 |
---|---|---|
committer | pacien | 2020-09-08 20:52:28 +0200 |
commit | b06679f628eeb5b6e7f917ee79024e4808ca8303 (patch) | |
tree | 9ac58cec7996e47534e70d24b406f1b48ad6d626 | |
parent | 8e2e04233a4bbb00cd780830769d5237f085dd02 (diff) | |
download | tincapp-b06679f628eeb5b6e7f917ee79024e4808ca8303.tar.gz |
treewide: fix code style issues reported by linter
7 files changed, 12 insertions, 15 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/configure/ToolsFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/configure/ToolsFragment.kt index 2135f59..9d30bee 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/configure/ToolsFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/configure/ToolsFragment.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -45,6 +45,6 @@ class ToolsFragment : BaseFragment() { | |||
45 | return binding.root | 45 | return binding.root |
46 | } | 46 | } |
47 | 47 | ||
48 | private fun openDialog(tool: ConfigurationToolDialogFragment) = | 48 | private fun openDialog(tool: ConfigurationToolDialogFragment): () -> Unit = |
49 | { tool.show(fragmentManager, tool.javaClass.simpleName) } | 49 | { tool.show(fragmentManager, tool.javaClass.simpleName) } |
50 | } | 50 | } |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt b/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt index 45c9c08..909078f 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/start/StartActivity.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -48,7 +48,7 @@ class StartActivity : BaseActivity() { | |||
48 | Actions.EVENT_ABORTED to this::onVpnStartError | 48 | Actions.EVENT_ABORTED to this::onVpnStartError |
49 | )) | 49 | )) |
50 | 50 | ||
51 | var connectDialog: AlertDialog? = null | 51 | private var connectDialog: AlertDialog? = null |
52 | 52 | ||
53 | override fun onCreate(savedInstanceState: Bundle?) { | 53 | override fun onCreate(savedInstanceState: Bundle?) { |
54 | super.onCreate(savedInstanceState) | 54 | super.onCreate(savedInstanceState) |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt index 2e8c139..06bb0a4 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListViewModel.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -19,7 +19,6 @@ | |||
19 | package org.pacien.tincapp.activities.status.nodes | 19 | package org.pacien.tincapp.activities.status.nodes |
20 | 20 | ||
21 | import androidx.lifecycle.ViewModel | 21 | import androidx.lifecycle.ViewModel |
22 | import org.pacien.tincapp.service.TincVpnService | ||
23 | 22 | ||
24 | /** | 23 | /** |
25 | * @author pacien | 24 | * @author pacien |
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt index dc47b40..3e08d79 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetListViewModel.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -19,7 +19,6 @@ | |||
19 | package org.pacien.tincapp.activities.status.subnets | 19 | package org.pacien.tincapp.activities.status.subnets |
20 | 20 | ||
21 | import androidx.lifecycle.ViewModel | 21 | import androidx.lifecycle.ViewModel |
22 | import org.pacien.tincapp.service.TincVpnService | ||
23 | 22 | ||
24 | /** | 23 | /** |
25 | * @author pacien | 24 | * @author pacien |
diff --git a/app/src/main/java/org/pacien/tincapp/commands/Command.kt b/app/src/main/java/org/pacien/tincapp/commands/Command.kt index 132cda9..782865a 100644 --- a/app/src/main/java/org/pacien/tincapp/commands/Command.kt +++ b/app/src/main/java/org/pacien/tincapp/commands/Command.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -37,7 +37,7 @@ internal class Command(private val cmd: String) { | |||
37 | } | 37 | } |
38 | 38 | ||
39 | fun withArguments(vararg args: String): Command { | 39 | fun withArguments(vararg args: String): Command { |
40 | this.args.addAll(Arrays.asList(*args)) | 40 | this.args.addAll(listOf(*args)) |
41 | return this | 41 | return this |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/app/src/main/java/org/pacien/tincapp/data/VpnInterfaceConfiguration.kt b/app/src/main/java/org/pacien/tincapp/data/VpnInterfaceConfiguration.kt index c98b567..937213e 100644 --- a/app/src/main/java/org/pacien/tincapp/data/VpnInterfaceConfiguration.kt +++ b/app/src/main/java/org/pacien/tincapp/data/VpnInterfaceConfiguration.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2019 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -77,8 +77,7 @@ data class VpnInterfaceConfiguration(val addresses: List<CidrAddress> = emptyLis | |||
77 | fun fromInvitation(f: File) = fromInvitation(Configurations().properties(f)) | 77 | fun fromInvitation(f: File) = fromInvitation(Configurations().properties(f)) |
78 | private fun fromInvitation(c: Configuration) = VpnInterfaceConfiguration( | 78 | private fun fromInvitation(c: Configuration) = VpnInterfaceConfiguration( |
79 | c.getStringList(INVITATION_KEY_ADDRESSES) | 79 | c.getStringList(INVITATION_KEY_ADDRESSES) |
80 | .map { applyIgnoringException(CidrAddress.Companion::fromSlashSeparated, it) } | 80 | .mapNotNull { applyIgnoringException(CidrAddress.Companion::fromSlashSeparated, it) }, |
81 | .filterNotNull(), | ||
82 | c.getStringList(INVITATION_KEY_ROUTES) | 81 | c.getStringList(INVITATION_KEY_ROUTES) |
83 | .map { it.substringBefore(' ') } | 82 | .map { it.substringBefore(' ') } |
84 | .map { CidrAddress.fromSlashSeparated(it) }) | 83 | .map { CidrAddress.fromSlashSeparated(it) }) |
diff --git a/app/src/main/java/org/pacien/tincapp/intent/Actions.kt b/app/src/main/java/org/pacien/tincapp/intent/Actions.kt index 85cfd29..62c1175 100644 --- a/app/src/main/java/org/pacien/tincapp/intent/Actions.kt +++ b/app/src/main/java/org/pacien/tincapp/intent/Actions.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -35,5 +35,5 @@ object Actions { | |||
35 | const val TINC_SCHEME = "tinc" | 35 | const val TINC_SCHEME = "tinc" |
36 | 36 | ||
37 | fun buildNetworkUri(netName: String, passphrase: String? = null): Uri = | 37 | fun buildNetworkUri(netName: String, passphrase: String? = null): Uri = |
38 | Uri.Builder().scheme(Actions.TINC_SCHEME).opaquePart(netName).fragment(passphrase).build() | 38 | Uri.Builder().scheme(TINC_SCHEME).opaquePart(netName).fragment(passphrase).build() |
39 | } | 39 | } |