This repository was archived by the owner on Oct 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
app/src/main/java/app/passwordstore/util/viewmodel Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,19 @@ val PasswordItem.stableId: String
94
94
enum class FilterMode {
95
95
NoFilter ,
96
96
StrictDomain ,
97
- Fuzzy
97
+ Fuzzy ,
98
+ Exact ,
98
99
}
99
100
100
101
enum class SearchMode {
101
102
RecursivelyInSubdirectories ,
102
- InCurrentDirectoryOnly
103
+ InCurrentDirectoryOnly ,
103
104
}
104
105
105
106
enum class ListMode {
106
107
FilesOnly ,
107
108
DirectoriesOnly ,
108
- AllEntries
109
+ AllEntries ,
109
110
}
110
111
111
112
@OptIn(ExperimentalCoroutinesApi ::class )
@@ -219,6 +220,16 @@ constructor(
219
220
.toList()
220
221
.sortedWith(itemComparator)
221
222
}
223
+ FilterMode .Exact -> {
224
+ prefilteredResultFlow
225
+ .filter { absoluteFile ->
226
+ absoluteFile.relativeTo(root).path.contains(searchAction.filter)
227
+ }
228
+ .map { it.toPasswordItem() }
229
+ .flowOn(dispatcherProvider.io())
230
+ .toList()
231
+ .sortedWith(itemComparator)
232
+ }
222
233
FilterMode .StrictDomain -> {
223
234
check(searchAction.listMode == ListMode .FilesOnly ) {
224
235
" Searches with StrictDomain search mode can only list files"
You can’t perform that action at this time.
0 commit comments