mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 02:09:35 +02:00
native code: synchronization with C++ version
This commit is contained in:
parent
6fd4e1e98f
commit
d93770c0f8
111 changed files with 804 additions and 697 deletions
|
@ -27,12 +27,12 @@
|
|||
extern "C"
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_geometerplus_fbreader_formats_PluginCollection_nativePlugins(JNIEnv* env, jobject thiz) {
|
||||
const std::vector<shared_ptr<FormatPlugin> > plugins = PluginCollection::Instance().plugins();
|
||||
const size_t size = plugins.size();
|
||||
const std::size_t size = plugins.size();
|
||||
jclass cls = AndroidUtil::Class_NativeFormatPlugin.j();
|
||||
// TODO: memory leak?
|
||||
jobjectArray javaPlugins = env->NewObjectArray(size, cls, 0);
|
||||
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
for (std::size_t i = 0; i < size; ++i) {
|
||||
jstring fileType = AndroidUtil::createJavaString(env, plugins[i]->supportedFileType());
|
||||
jobject p = AndroidUtil::StaticMethod_NativeFormatPlugin_create->call(fileType);
|
||||
env->SetObjectArrayElement(javaPlugins, i, p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue