Merge pull request #2155 from Merkost/backup_improve

Backup improve
This commit is contained in:
Tibor Kaputa 2023-07-18 07:03:47 +02:00 committed by GitHub
commit 2131fa1349
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 22 deletions

View file

@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'de.timfreiheit.resourceplaceholders'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'de.timfreiheit.resourceplaceholders'
}
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()

View file

@ -3,8 +3,6 @@ package com.simplemobiletools.calendar.pro.helpers
import android.content.Context
import android.media.AudioManager
import android.media.RingtoneManager
import android.os.Environment
import android.os.Environment.DIRECTORY_DOWNLOADS
import com.simplemobiletools.calendar.pro.R
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.scheduleCalDAVSync
@ -261,18 +259,6 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(WAS_FILTERED_OUT_WARNING_SHOWN, false)
set(wasFilteredOutWarningShown) = prefs.edit().putBoolean(WAS_FILTERED_OUT_WARNING_SHOWN, wasFilteredOutWarningShown).apply()
var autoBackup: Boolean
get() = prefs.getBoolean(AUTO_BACKUP, false)
set(autoBackup) = prefs.edit().putBoolean(AUTO_BACKUP, autoBackup).apply()
var autoBackupFolder: String
get() = prefs.getString(AUTO_BACKUP_FOLDER, Environment.getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS).absolutePath)!!
set(autoBackupFolder) = prefs.edit().putString(AUTO_BACKUP_FOLDER, autoBackupFolder).apply()
var autoBackupFilename: String
get() = prefs.getString(AUTO_BACKUP_FILENAME, "")!!
set(autoBackupFilename) = prefs.edit().putString(AUTO_BACKUP_FILENAME, autoBackupFilename).apply()
var autoBackupEventTypes: Set<String>
get() = prefs.getStringSet(AUTO_BACKUP_EVENT_TYPES, HashSet())!!
set(autoBackupEventTypes) = prefs.edit().remove(AUTO_BACKUP_EVENT_TYPES).putStringSet(AUTO_BACKUP_EVENT_TYPES, autoBackupEventTypes).apply()
@ -289,7 +275,4 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(AUTO_BACKUP_PAST_ENTRIES, true)
set(autoBackupPastEntries) = prefs.edit().putBoolean(AUTO_BACKUP_PAST_ENTRIES, autoBackupPastEntries).apply()
var lastAutoBackupTime: Long
get() = prefs.getLong(LAST_AUTO_BACKUP_TIME, 0L)
set(lastAutoBackupTime) = prefs.edit().putLong(LAST_AUTO_BACKUP_TIME, lastAutoBackupTime).apply()
}