mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Android: Use VectorToJStringArray in GameFileCache.cpp
This commit is contained in:
@ -69,20 +69,8 @@ JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_add
|
|||||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_update(
|
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_model_GameFileCache_update(
|
||||||
JNIEnv* env, jobject obj, jobjectArray folder_paths, jboolean recursive_scan)
|
JNIEnv* env, jobject obj, jobjectArray folder_paths, jboolean recursive_scan)
|
||||||
{
|
{
|
||||||
jsize size = env->GetArrayLength(folder_paths);
|
|
||||||
|
|
||||||
std::vector<std::string> folder_paths_vector;
|
|
||||||
folder_paths_vector.reserve(size);
|
|
||||||
|
|
||||||
for (jsize i = 0; i < size; ++i)
|
|
||||||
{
|
|
||||||
const auto path = reinterpret_cast<jstring>(env->GetObjectArrayElement(folder_paths, i));
|
|
||||||
folder_paths_vector.push_back(GetJString(env, path));
|
|
||||||
env->DeleteLocalRef(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetPointer(env, obj)->Update(
|
return GetPointer(env, obj)->Update(
|
||||||
UICommon::FindAllGamePaths(folder_paths_vector, recursive_scan));
|
UICommon::FindAllGamePaths(JStringArrayToVector(env, folder_paths), recursive_scan));
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL
|
JNIEXPORT jboolean JNICALL
|
||||||
|
Reference in New Issue
Block a user