diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt index 84af14696..6f4741dbf 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt @@ -733,13 +733,8 @@ abstract class BaseSimpleActivity : AppCompatActivity() { } private fun getExportSettingsFilename(): String { - var defaultFilename = baseConfig.lastExportedSettingsFile - if (defaultFilename.isEmpty()) { - val appName = baseConfig.appId.removeSuffix(".debug").removeSuffix(".pro").removePrefix("com.simplemobiletools.") - defaultFilename = "$appName-settings_${getCurrentFormattedDateTime()}.txt" - } - - return defaultFilename + val appName = baseConfig.appId.removeSuffix(".debug").removeSuffix(".pro").removePrefix("com.simplemobiletools.") + return "$appName-settings_${getCurrentFormattedDateTime()}.txt" } @SuppressLint("InlinedApi") diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ExportSettingsDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ExportSettingsDialog.kt index 8b4b8bf4c..718688039 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ExportSettingsDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ExportSettingsDialog.kt @@ -45,7 +45,6 @@ class ExportSettingsDialog(val activity: BaseSimpleActivity, val defaultFilename return@setOnClickListener } - activity.baseConfig.lastExportedSettingsFile = filename val newPath = "${folder.trimEnd('/')}/$filename" if (!newPath.getFilenameFromPath().isAValidFilename()) { activity.toast(R.string.filename_invalid_characters) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt index 10e3aa5cc..7917073e3 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt @@ -440,10 +440,6 @@ open class BaseConfig(val context: Context) { get() = prefs.getString(LAST_EXPORTED_SETTINGS_FOLDER, "")!! set(lastExportedSettingsFolder) = prefs.edit().putString(LAST_EXPORTED_SETTINGS_FOLDER, lastExportedSettingsFolder).apply() - var lastExportedSettingsFile: String - get() = prefs.getString(LAST_EXPORTED_SETTINGS_FILE, "")!! - set(lastExportedSettingsFile) = prefs.edit().putString(LAST_EXPORTED_SETTINGS_FILE, lastExportedSettingsFile).apply() - var lastBlockedNumbersExportPath: String get() = prefs.getString(LAST_BLOCKED_NUMBERS_EXPORT_PATH, "")!! set(lastBlockedNumbersExportPath) = prefs.edit().putString(LAST_BLOCKED_NUMBERS_EXPORT_PATH, lastBlockedNumbersExportPath).apply()