[sword-svn] r3574 - in trunk/bindings: cordova/org.crosswire.sword.cordova.SWORD/src/android java-jni/jni

scribe at crosswire.org scribe at crosswire.org
Sun Mar 11 14:59:28 MST 2018


Author: scribe
Date: 2018-03-11 14:59:28 -0700 (Sun, 11 Mar 2018)
New Revision: 3574

Modified:
   trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/android/SWORD.java
   trunk/bindings/java-jni/jni/swordstub.cpp
Log:
Added better handling of incorrect key set to a module.  Added more debug output for BibleSync

Modified: trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/android/SWORD.java
===================================================================
--- trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/android/SWORD.java	2018-02-20 09:41:42 UTC (rev 3573)
+++ trunk/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/android/SWORD.java	2018-03-11 21:59:28 UTC (rev 3574)
@@ -519,6 +519,9 @@
 
 		String currentKey[]   = masterMod.getKeyChildren();
 
+		// assert we have a valid location
+		if (currentKey.length <= SWModule.VERSEKEY_BOOKABBREV || currentKey.length <= SWModule.VERSEKEY_CHAPTER) return r;
+
 		masterMod.setKeyText(currentKey[SWModule.VERSEKEY_BOOKABBREV]+"."+currentKey[SWModule.VERSEKEY_CHAPTER]+".1");
 
 		String [] verseKey = masterMod.getKeyChildren();

Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp	2018-02-20 09:41:42 UTC (rev 3573)
+++ trunk/bindings/java-jni/jni/swordstub.cpp	2018-03-11 21:59:28 UTC (rev 3574)
@@ -171,6 +171,12 @@
 		}
 		confPath = STORAGE_BASE + "/extraConfig.conf";
 		bool exists = FileMgr::existsFile(confPath.c_str());
+		if (!exists) {
+			SWConfig config(confPath.c_str());
+			config["Globals"]["HiAndroid"] = "weeee";
+			config.save();
+			exists = true;
+		}
 SWLog::getSystemLog()->logDebug("libsword: extraConfig %s at path: %s", exists?"Exists":"Absent", confPath.c_str());
 
 SWLog::getSystemLog()->logDebug("libsword: init() creating WebMgr using path: %s", baseDir.c_str());
@@ -179,6 +185,7 @@
 SWLog::getSystemLog()->logDebug("libsword: init() augmenting modules from: %s", AND_BIBLE_MODULES_PATH);
 		// for And Bible modules
 		mgr->augmentModules(AND_BIBLE_MODULES_PATH, true);
+SWLog::getSystemLog()->logDebug("libsword: init() end.");
 	}
 }
 
@@ -219,6 +226,7 @@
 
 #ifdef BIBLESYNC
 void bibleSyncCallback(char cmd, string pkt_uuid, string bible, string ref, string alt, string group, string domain, string info, string dump) {
+//void bibleSyncCallback(char cmd, string bible, string ref, string alt, string group, string domain, string info, string dump) {
 SWLog::getSystemLog()->logDebug("bibleSync callback msg: %c; pkt_uuid: %s; bible: %s; ref: %s; alt: %s; group: %s; domain: %s; info: %s; dump: %s", cmd, pkt_uuid.c_str(), bible.c_str(), ref.c_str(), alt.c_str(), group.c_str(), domain.c_str(), info.c_str(), dump.c_str());
 	if (::bibleSyncListener) {
 SWLog::getSystemLog()->logDebug("bibleSync listener is true");
@@ -1938,8 +1946,9 @@
 	const char *osisRef = env->GetStringUTFChars(osisRefJS, NULL);
 
 #ifdef BIBLESYNC
-	BibleSync_xmit_status retval = bibleSync->Transmit(BSP_SYNC, "Bible", osisRef);
+	BibleSync_xmit_status result = bibleSync->Transmit(BSP_SYNC, "Bible", osisRef);
 #endif
+SWLog::getSystemLog()->logDebug("libsword: sendBibleSyncMessage() finished with status code: %d", result);
 
 	env->ReleaseStringUTFChars(osisRefJS, osisRef);
 }




More information about the sword-cvs mailing list