From 8b815df88465a22675b01616034418d1f64ab521 Mon Sep 17 00:00:00 2001 From: merkost Date: Sun, 16 Jul 2023 09:51:11 +1000 Subject: [PATCH] Moved shared config to commons lib --- .../contacts/pro/helpers/Config.kt | 18 +----------------- .../contacts/pro/helpers/Constants.kt | 5 ----- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt index 328ea41a..21822187 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt @@ -1,7 +1,6 @@ package com.simplemobiletools.contacts.pro.helpers import android.content.Context -import android.os.Environment import com.simplemobiletools.commons.helpers.BaseConfig import com.simplemobiletools.commons.helpers.SHOW_TABS @@ -14,23 +13,8 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK) set(showTabs) = prefs.edit().putInt(SHOW_TABS, showTabs).apply() - var autoBackup: Boolean - get() = prefs.getBoolean(AUTO_BACKUP, false) - set(enableAutomaticBackups) = prefs.edit().putBoolean(AUTO_BACKUP, enableAutomaticBackups).apply() - - var autoBackupFolder: String - get() = prefs.getString(AUTO_BACKUP_FOLDER, Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath)!! - set(autoBackupPath) = prefs.edit().putString(AUTO_BACKUP_FOLDER, autoBackupPath).apply() - - var autoBackupFilename: String - get() = prefs.getString(AUTO_BACKUP_FILENAME, "")!! - set(autoBackupFilename) = prefs.edit().putString(AUTO_BACKUP_FILENAME, autoBackupFilename).apply() - var autoBackupContactSources: Set get() = prefs.getStringSet(AUTO_BACKUP_CONTACT_SOURCES, setOf())!! - set(autoBackupContactTypes) = prefs.edit().remove(AUTO_BACKUP_CONTACT_SOURCES).putStringSet(AUTO_BACKUP_CONTACT_SOURCES, autoBackupContactTypes).apply() + set(autoBackupContactSources) = prefs.edit().remove(AUTO_BACKUP_CONTACT_SOURCES).putStringSet(AUTO_BACKUP_CONTACT_SOURCES, autoBackupContactSources).apply() - var lastAutoBackupTime: Long - get() = prefs.getLong(LAST_AUTO_BACKUP_TIME, 0L) - set(lastAutoBackupTime) = prefs.edit().putLong(LAST_AUTO_BACKUP_TIME, lastAutoBackupTime).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt index 204a9e6a..a51d3504 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt @@ -17,11 +17,6 @@ const val AVOID_CHANGING_VISIBILITY_TAG = "avoid_changing_visibility_tag" const val AUTOMATIC_BACKUP_REQUEST_CODE = 10001 const val AUTO_BACKUP_INTERVAL_IN_DAYS = 1 -const val AUTO_BACKUP = "auto_backup" -const val AUTO_BACKUP_FOLDER = "auto_backup_folder" -const val AUTO_BACKUP_FILENAME = "auto_backup_filename" -const val LAST_AUTO_BACKUP_TIME = "last_auto_backup_time" - const val AUTO_BACKUP_CONTACT_SOURCES = "auto_backup_contact_sources" // extras used at third party intents