[sword-svn] r3794 - trunk/bindings/java-jni/jni

scribe at crosswire.org scribe at crosswire.org
Thu Sep 17 08:28:03 EDT 2020


Author: scribe
Date: 2020-09-17 08:28:03 -0400 (Thu, 17 Sep 2020)
New Revision: 3794

Modified:
   trunk/bindings/java-jni/jni/swordstub.cpp
Log:
updated java-jni bindings to work with 1.9.0 SWMgr::getModules() and SWMgr::getModule, to support "Utility" modules


Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp	2020-09-11 16:43:08 UTC (rev 3793)
+++ trunk/bindings/java-jni/jni/swordstub.cpp	2020-09-17 12:28:03 UTC (rev 3794)
@@ -429,7 +429,7 @@
 	init(env);
 
 	int size = 0;
-	for (sword::ModMap::iterator it = mgr->Modules.begin(); it != mgr->Modules.end(); ++it) {
+	for (sword::ModMap::iterator it = mgr->getModules().begin(); it != mgr->getModules().end(); ++it) {
 //		if ((!(it->second->getConfigEntry("CipherKey"))) || (*(it->second->getConfigEntry("CipherKey"))))
 			size++;
 	}
@@ -451,7 +451,7 @@
 	jobjectArray ret = (jobjectArray) env->NewObjectArray(size, clazzModInfo, NULL);
 
 	int i = 0;
-	for (sword::ModMap::iterator it = mgr->Modules.begin(); it != mgr->Modules.end(); ++it) {
+	for (sword::ModMap::iterator it = mgr->getModules().begin(); it != mgr->getModules().end(); ++it) {
 		SWModule *module = it->second;
 
 		SWBuf type = module->getType();
@@ -1884,12 +1884,10 @@
 
 SWLog::getSystemLog()->logDebug("uninstallModule %s\n", modName);
 
-	SWModule *module;
-	ModMap::iterator it = mgr->Modules.find(modName);
-	if (it == mgr->Modules.end()) {
+	const SWModule *module = mgr->getModule(modName);
+	if (!module) {
 		return -2;
 	}
-	module = it->second;
 	int retVal = installMgr->removeModule(mgr, module->getName());
 
 	env->ReleaseStringUTFChars(modNameJS, modName);
@@ -2073,19 +2071,16 @@
 
 	InstallSource *is = source->second;
 	SWMgr *rmgr = is->getMgr();
-	SWModule *module;
 
 	const char *modName = env->GetStringUTFChars(modNameJS, NULL);
 SWLog::getSystemLog()->logDebug("remoteInstallModule: modName: %s\n", modName);
-	ModMap::iterator it = rmgr->Modules.find(modName);
+	const SWModule *module = rmgr->getModule(modName);
 	env->ReleaseStringUTFChars(modNameJS, modName);
 
-	if (it == rmgr->Modules.end()) {
+	if (!module) {
 		return -4;
 	}
 
-	module = it->second;
-
 	int error = installMgr->installModule(mgr, 0, module->getName(), is);
 
 	if (progressReporter) {



More information about the sword-cvs mailing list