Skip to content

Commit ca847f8

Browse files
committed
Fixed decompressed directory filename not using ZIP name (#120)
1 parent 8ea4937 commit ca847f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/main/kotlin/org/fossify/filemanager/activities/DecompressActivity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class DecompressActivity : SimpleActivity() {
3131
private var uri: Uri? = null
3232
private var password: String? = null
3333
private var passwordDialog: EnterPasswordDialog? = null
34+
private var filename = ""
3435

3536
override fun onCreate(savedInstanceState: Bundle?) {
3637
isMaterialActivity = true
@@ -51,7 +52,8 @@ class DecompressActivity : SimpleActivity() {
5152
password = savedInstanceState?.getString(PASSWORD, null)
5253

5354
val realPath = getRealPathFromURI(uri!!)
54-
binding.decompressToolbar.title = realPath?.getFilenameFromPath() ?: Uri.decode(uri.toString().getFilenameFromPath())
55+
filename = realPath?.getFilenameFromPath() ?: Uri.decode(uri.toString().getFilenameFromPath())
56+
binding.decompressToolbar.title = filename
5557
setupFilesList()
5658
}
5759

@@ -145,7 +147,7 @@ class DecompressActivity : SimpleActivity() {
145147
zipInputStream.use {
146148
while (true) {
147149
val entry = zipInputStream.nextEntry ?: break
148-
val filename = title.toString().substringBeforeLast(".")
150+
val filename = filename.substringBeforeLast(".")
149151
val parent = "$destination/$filename"
150152
val newPath = "$parent/${entry.fileName.trimEnd('/')}"
151153

0 commit comments

Comments
 (0)