Skip to content

Android: Convert ContentHandler to Kotlin and fix warnings#14630

Open
Simonx22 wants to merge 1 commit into
dolphin-emu:masterfrom
Simonx22:android/convert-contenthandler-to-kotlin
Open

Android: Convert ContentHandler to Kotlin and fix warnings#14630
Simonx22 wants to merge 1 commit into
dolphin-emu:masterfrom
Simonx22:android/convert-contenthandler-to-kotlin

Conversation

@Simonx22
Copy link
Copy Markdown
Member

No description provided.

fun getChildNames(uri: Uri, recursive: Boolean): Array<String> {
val result = ArrayList<String>()

if (recursive) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for explicitly writing out the non-recursive case separately from the recursive case, unlike in Java? (Also in doFileSearch.)

}

private fun forEachChild(
uri: Uri, documentId: String, callback: (String, String, Boolean) -> Unit
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit unfortunate that the callback parameters are no longer named here. I don't know if there's an idiomatic way to have that in Kotlin, though.

Comment on lines +284 to +285
* This seems to hold for all common storage providers, but it is theoretically for a storage
* provider to use URIs without any % characters.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is my mistake, but if you want to fix it while you're at it:

Suggested change
* This seems to hold for all common storage providers, but it is theoretically for a storage
* provider to use URIs without any % characters.
* This seems to hold for all common storage providers, but it is theoretically possible for a
* storage provider to use URIs without any % characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants