-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't automatically disable filters after editing or on creation.
Might be a bit more dangerous but it's super frustrating. (and if we create one via analyzer, then the user needs to navigate and extra round-trip just to enable it.
- Loading branch information
Showing
9 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/src/main/java/eu/darken/sdmse/systemcleaner/core/filter/custom/CustomFilterExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package eu.darken.sdmse.systemcleaner.core.filter.custom | ||
|
||
import eu.darken.sdmse.common.datastore.value | ||
import eu.darken.sdmse.common.debug.logging.log | ||
import eu.darken.sdmse.common.debug.logging.logTag | ||
import eu.darken.sdmse.systemcleaner.core.SystemCleanerSettings | ||
import eu.darken.sdmse.systemcleaner.core.filter.FilterIdentifier | ||
import kotlinx.coroutines.flow.first | ||
|
||
|
||
suspend fun CustomFilterRepo.currentConfigs() = configs.first() | ||
|
||
|
||
suspend fun SystemCleanerSettings.toggleCustomFilter(filterId: FilterIdentifier, enabled: Boolean? = null) { | ||
log(TAG) { "toggleCustomFilter($filterId, $enabled)" } | ||
enabledCustomFilter.update { | ||
if (it.contains(filterId) || enabled == false) it - filterId else it + filterId | ||
} | ||
} | ||
|
||
suspend fun SystemCleanerSettings.clearCustomFilter(filterId: FilterIdentifier) { | ||
log(TAG) { "clearCustomFilter($filterId)" } | ||
enabledCustomFilter.update { it - filterId } | ||
} | ||
|
||
suspend fun SystemCleanerSettings.isCustomFilterEnabled(filterId: FilterIdentifier): Boolean { | ||
return enabledCustomFilter.value().contains(filterId) | ||
} | ||
|
||
private val TAG = logTag("SystemCleaner", "CustomFilter") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
.../main/java/eu/darken/sdmse/systemcleaner/core/filter/custom/CustomFilterRepoExtensions.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters