Remove remaining EteSync v1 code

pull/2945/head
Alex Baker 4 months ago
parent ddfedb58ae
commit f8633bbd63

@ -416,11 +416,6 @@
android:name=".caldav.CaldavAccountSettingsActivity"
android:theme="@style/Tasks"/>
<!--suppress DeprecatedClassUsageInspection -->
<activity
android:name=".etesync.EteSyncAccountSettingsActivity"
android:theme="@style/Tasks" />
<activity
android:name=".etebase.EtebaseAccountSettingsActivity"
android:theme="@style/Tasks" />

@ -209,8 +209,7 @@ class MainActivity : AppCompatActivity() {
)
NavigationDrawerSubheader.SubheaderType.CALDAV,
NavigationDrawerSubheader.SubheaderType.TASKS,
NavigationDrawerSubheader.SubheaderType.ETESYNC ->
NavigationDrawerSubheader.SubheaderType.TASKS ->
startActivityForResult(
Intent(
this@MainActivity,

@ -198,8 +198,7 @@ class MainActivityViewModel @Inject constructor(
}
NavigationDrawerSubheader.SubheaderType.GOOGLE_TASKS,
NavigationDrawerSubheader.SubheaderType.CALDAV,
NavigationDrawerSubheader.SubheaderType.TASKS,
NavigationDrawerSubheader.SubheaderType.ETESYNC -> {
NavigationDrawerSubheader.SubheaderType.TASKS -> {
caldavDao.setCollapsed(subheader.id, collapsed)
localBroadcastManager.broadcastRefreshList()
}

@ -18,7 +18,6 @@ import org.tasks.filters.FilterProvider.Companion.REQUEST_NEW_PLACE
import org.tasks.filters.FilterProvider.Companion.REQUEST_NEW_TAGS
import org.tasks.filters.NavigationDrawerSubheader
import org.tasks.filters.NavigationDrawerSubheader.SubheaderType.CALDAV
import org.tasks.filters.NavigationDrawerSubheader.SubheaderType.ETESYNC
import org.tasks.filters.NavigationDrawerSubheader.SubheaderType.GOOGLE_TASKS
import org.tasks.filters.NavigationDrawerSubheader.SubheaderType.PREFERENCE
import org.tasks.filters.NavigationDrawerSubheader.SubheaderType.TASKS
@ -41,8 +40,7 @@ class SubheaderClickHandler @Inject constructor(
PREFERENCE -> preferences.setBoolean(subheader.id.toInt(), collapsed)
GOOGLE_TASKS,
CALDAV,
TASKS,
ETESYNC -> caldavDao.setCollapsed(subheader.id, collapsed)
TASKS -> caldavDao.setCollapsed(subheader.id, collapsed)
}
localBroadcastManager.broadcastRefreshList()
}
@ -80,8 +78,7 @@ class SubheaderClickHandler @Inject constructor(
)
NavigationDrawerSubheader.SubheaderType.CALDAV,
NavigationDrawerSubheader.SubheaderType.TASKS,
NavigationDrawerSubheader.SubheaderType.ETESYNC ->
NavigationDrawerSubheader.SubheaderType.TASKS ->
activity.startActivityForResult(
Intent(activity, account.listSettingsClass())
.putExtra(

@ -9,7 +9,6 @@ import androidx.recyclerview.widget.RecyclerView
import org.tasks.R
import org.tasks.databinding.FilterAdapterSubheaderBinding
import org.tasks.filters.NavigationDrawerSubheader
import org.tasks.filters.NavigationDrawerSubheader.SubheaderType.ETESYNC
internal class SubheaderViewHolder(
itemView: View,
@ -35,7 +34,7 @@ internal class SubheaderViewHolder(
this.subheader = subheader
text.text = subheader.title
when {
subheader.error || subheader.subheaderType == ETESYNC ->
subheader.error ->
with(errorIcon) {
setColorFilter(ContextCompat.getColor(itemView.context, R.color.overdue))
visibility = View.VISIBLE

@ -14,7 +14,6 @@ import org.tasks.data.OpenTaskDao.Companion.isEteSync
import org.tasks.data.entity.CaldavAccount
import org.tasks.etebase.EtebaseAccountSettingsActivity
import org.tasks.etebase.EtebaseCalendarSettingsActivity
import org.tasks.etesync.EteSyncAccountSettingsActivity
import org.tasks.opentasks.OpenTaskAccountSettingsActivity
import org.tasks.opentasks.OpenTasksListSettingsActivity
import org.tasks.security.KeyStoreEncryption
@ -25,7 +24,6 @@ val CaldavAccount.prefTitle: Int
isTasksOrg -> R.string.tasks_org
isCaldavAccount -> R.string.caldav
isEtebaseAccount || uuid.isEteSync() -> R.string.etesync
isEteSyncAccount -> R.string.etesync_v1
uuid.isDavx5() || uuid.isDavx5Managed() -> R.string.davx5
uuid.isDecSync() -> R.string.decsync
isMicrosoft -> R.string.microsoft
@ -37,7 +35,7 @@ val CaldavAccount.prefIcon: Int
get() = when {
isTasksOrg -> R.drawable.ic_round_icon
isCaldavAccount -> R.drawable.ic_webdav_logo
isEtebaseAccount || isEteSyncAccount || uuid.isEteSync() -> R.drawable.ic_etesync
isEtebaseAccount || uuid.isEteSync() -> R.drawable.ic_etesync
uuid.isDavx5() -> R.drawable.ic_davx5_icon_green_bg
uuid.isDavx5Managed() -> R.drawable.ic_davx5_icon_blue_bg
uuid.isDecSync() -> R.drawable.ic_decsync
@ -55,7 +53,7 @@ fun CaldavAccount.isTasksSubscription(context: Context): Boolean {
fun CaldavAccount.listSettingsClass(): Class<out Activity> = when(accountType) {
CaldavAccount.TYPE_LOCAL -> LocalListSettingsActivity::class.java
CaldavAccount.TYPE_ETESYNC, CaldavAccount.TYPE_OPENTASKS -> OpenTasksListSettingsActivity::class.java
CaldavAccount.TYPE_OPENTASKS -> OpenTasksListSettingsActivity::class.java
CaldavAccount.TYPE_ETEBASE -> EtebaseCalendarSettingsActivity::class.java
CaldavAccount.TYPE_MICROSOFT -> MicrosoftListSettingsActivity::class.java
else -> CaldavCalendarSettingsActivity::class.java
@ -64,7 +62,6 @@ fun CaldavAccount.listSettingsClass(): Class<out Activity> = when(accountType) {
val CaldavAccount.accountSettingsClass: Class<out BaseCaldavAccountSettingsActivity>
get() = when {
isCaldavAccount -> CaldavAccountSettingsActivity::class.java
isEteSyncAccount -> EteSyncAccountSettingsActivity::class.java
isEtebaseAccount -> EtebaseAccountSettingsActivity::class.java
isOpenTasks -> OpenTaskAccountSettingsActivity::class.java
else -> throw IllegalArgumentException("Unexpected account type: $this")

@ -81,8 +81,7 @@ class FilterPickerViewModel @Inject constructor(
preferences.setBoolean(subheader.id.toInt(), collapsed)
NavigationDrawerSubheader.SubheaderType.GOOGLE_TASKS,
NavigationDrawerSubheader.SubheaderType.CALDAV,
NavigationDrawerSubheader.SubheaderType.TASKS,
NavigationDrawerSubheader.SubheaderType.ETESYNC ->
NavigationDrawerSubheader.SubheaderType.TASKS ->
caldavDao.setCollapsed(subheader.id, collapsed)
else -> throw IllegalStateException()

@ -1,52 +0,0 @@
package org.tasks.etesync
import android.os.Bundle
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.R
import org.tasks.Strings.isNullOrEmpty
import org.tasks.caldav.BaseCaldavAccountSettingsActivity
@Deprecated("use etebase")
@AndroidEntryPoint
class EteSyncAccountSettingsActivity : BaseCaldavAccountSettingsActivity(), Toolbar.OnMenuItemClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.showAdvanced.visibility = View.GONE
binding.serverSelector.visibility = View.GONE
binding.description.visibility = View.VISIBLE
binding.description.setTextColor(ContextCompat.getColor(this, R.color.overdue))
binding.description.setText(description)
binding.showAdvanced.setOnCheckedChangeListener { _, _ -> updateUrlVisibility() }
updateUrlVisibility()
}
override val description = R.string.etesync_deprecated
private fun updateUrlVisibility() {
binding.urlLayout.visibility = View.GONE
}
override fun needsValidation() = false
override fun hasChanges() = false
override suspend fun addAccount(url: String, username: String, password: String) {}
override suspend fun updateAccount(url: String, username: String, password: String) {}
override suspend fun updateAccount() {}
override val newURL: String
get() {
val url = super.newURL
return if (isNullOrEmpty(url)) getString(R.string.etesync_url) else url
}
override val newPassword: String
get() = binding.password.text.toString().trim { it <= ' ' }
override val helpUrl = R.string.url_etesync
}

@ -15,7 +15,6 @@ import org.tasks.data.dao.GoogleTaskListDao
import org.tasks.data.dao.LocationDao
import org.tasks.data.dao.TagDataDao
import org.tasks.data.entity.CaldavAccount
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_ETESYNC
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_LOCAL
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_OPENTASKS
import org.tasks.data.setupLocalAccount
@ -223,7 +222,7 @@ class FilterProvider @Inject constructor(
} else {
caldavFilter(
it,
showCreate && it.accountType != TYPE_OPENTASKS && it.accountType != TYPE_ETESYNC,
showCreate && it.accountType != TYPE_OPENTASKS,
forceExpand,
)
}
@ -246,7 +245,6 @@ class FilterProvider @Inject constructor(
collapsed,
when {
account.isTasksOrg -> SubheaderType.TASKS
account.isEteSyncAccount -> SubheaderType.ETESYNC
else -> SubheaderType.CALDAV
},
account.id,

@ -242,7 +242,7 @@ class MainSettingsFragment : InjectingPreferenceFragment() {
}
}
}
setupErrorIcon(pref, account.hasError, account.isEteSyncAccount)
setupErrorIcon(pref, account.hasError)
}
private fun setupErrorIcon(

@ -10,13 +10,10 @@
<string name="FSA_label">Tasks Shortcut</string>
<string name="caldav">CalDAV</string>
<string name="etesync">EteSync</string>
<string name="etesync_v1">EteSync v1</string>
<string name="davx5">DAVx⁵</string>
<string name="decsync">DecSync CC</string>
<string name="tasks_org">Tasks.org</string>
<string name="microsoft">Microsoft To Do</string>
<string name="etesync_url">https://api.etesync.com</string>
<string name="etesync_deprecated">Native EteSync v1 support has been removed. Please switch to the EteSync client to continue synchronizing your EteSync v1 account, or migrate to EteSync v2</string>
<string name="etebase_url">https://api.etebase.com/partner/tasksorg/</string>
<string name="help_url_sync">https://tasks.org/sync</string>
<string name="caldav_server_owncloud">ownCloud</string>

@ -14,7 +14,6 @@ import org.tasks.data.db.Database
import org.tasks.data.db.DbUtils.dbchunk
import org.tasks.data.db.SuspendDbUtils.chunkedMap
import org.tasks.data.entity.CaldavAccount
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_ETESYNC
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_GOOGLE_TASKS
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_LOCAL
import org.tasks.data.entity.CaldavAccount.Companion.TYPE_OPENTASKS
@ -231,7 +230,6 @@ SELECT EXISTS(SELECT 1
FROM caldav_lists
INNER JOIN caldav_accounts ON cdl_account = cda_uuid
WHERE cda_account_type != $TYPE_OPENTASKS
AND cda_account_type != $TYPE_ETESYNC
AND cdl_url IN (:urls))
""")
abstract suspend fun anyExist(urls: List<String>): Boolean

@ -42,10 +42,6 @@ data class CaldavAccount(
val isCaldavAccount: Boolean
get() = accountType == TYPE_CALDAV
@Deprecated("use etebase")
val isEteSyncAccount: Boolean
get() = accountType == TYPE_ETESYNC
val isEtebaseAccount: Boolean
get() = accountType == TYPE_ETEBASE
@ -87,7 +83,7 @@ data class CaldavAccount(
val ACCOUNT_TYPE = TABLE.column("cda_account_type")
const val TYPE_CALDAV = 0
@Deprecated("use etebase") const val TYPE_ETESYNC = 1
// const val TYPE_ETESYNC = 1
const val TYPE_LOCAL = 2
const val TYPE_OPENTASKS = 3
const val TYPE_TASKS = 4

@ -19,7 +19,5 @@ data class NavigationDrawerSubheader(
GOOGLE_TASKS,
CALDAV,
TASKS,
@Deprecated("")
ETESYNC
}
}

Loading…
Cancel
Save