DocumentsTree: Re-implement getFilename without resolvePath

This commit is contained in:
OpenSauce04 2026-03-05 21:26:24 +00:00 committed by OpenSauce
parent c71b2dc822
commit fac63ce6b1

View File

@ -77,8 +77,9 @@ class DocumentsTree {
@Synchronized
fun getFilename(filepath: String): String {
val node = resolvePath(filepath) ?: return ""
return node.name
val components = filepath.split(DELIMITER).filter { it.isNotEmpty() }
val filename = components.last()
return filename
}
@Synchronized