@@ -48,15 +48,16 @@ class ImportFolderDialog(val activity: SimpleActivity, val path: String, val cal
4848 else -> true
4949 }
5050 }.forEach {
51- val storePath = if (updateFilesOnEdit) it.path else " "
52- val storeContent = if (updateFilesOnEdit) " " else it.readText()
51+ val storePath = if (updateFilesOnEdit) it.absolutePath else " "
52+ val title = it.absolutePath.getFilenameFromPath()
53+ val value = if (updateFilesOnEdit) " " else it.readText()
5354
5455 if (updateFilesOnEdit) {
5556 activity.handleSAFDialog(path) {
56- lastSavedNoteId = saveNote(storeContent , storePath)
57+ lastSavedNoteId = saveNote(title, value , storePath)
5758 }
5859 } else {
59- lastSavedNoteId = saveNote(storeContent , storePath)
60+ lastSavedNoteId = saveNote(title, value , storePath)
6061 }
6162 }
6263
@@ -67,9 +68,8 @@ class ImportFolderDialog(val activity: SimpleActivity, val path: String, val cal
6768 dialog.dismiss()
6869 }
6970
70- private fun saveNote (storeContent : String , storePath : String ): Int {
71- val filename = storePath.getFilenameFromPath()
72- val note = Note (0 , filename, storeContent, TYPE_NOTE , storePath)
71+ private fun saveNote (title : String , value : String , path : String ): Int {
72+ val note = Note (0 , title, value, TYPE_NOTE , path)
7373 return activity.dbHelper.insertNote(note)
7474 }
7575}
0 commit comments