mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-07 20:46:17 +01:00
Merge branch 'android_branch' into android_gcm
This commit is contained in:
commit
d7d666e4f9
4 changed files with 18 additions and 4 deletions
|
@ -293,7 +293,9 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1getInfo
|
||||||
jDictBytes, jpath, NULL, check );
|
jDictBytes, jpath, NULL, check );
|
||||||
if ( NULL != dict ) {
|
if ( NULL != dict ) {
|
||||||
if ( NULL != jinfo ) {
|
if ( NULL != jinfo ) {
|
||||||
setInt( env, jinfo, "langCode", dict_getLangCode( dict ) );
|
XP_LangCode code = dict_getLangCode( dict );
|
||||||
|
XP_ASSERT( 0 < code );
|
||||||
|
setInt( env, jinfo, "langCode", code );
|
||||||
setInt( env, jinfo, "wordCount", dict_getWordCount( dict ) );
|
setInt( env, jinfo, "wordCount", dict_getWordCount( dict ) );
|
||||||
setString( env, jinfo, "md5Sum", dict_getMd5Sum( dict ) );
|
setString( env, jinfo, "md5Sum", dict_getMd5Sum( dict ) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,6 +381,14 @@ public class DictLangCache {
|
||||||
private static DictInfo getInfo( Context context, DictAndLoc dal )
|
private static DictInfo getInfo( Context context, DictAndLoc dal )
|
||||||
{
|
{
|
||||||
DictInfo info = DBUtils.dictsGetInfo( context, dal.name );
|
DictInfo info = DBUtils.dictsGetInfo( context, dal.name );
|
||||||
|
|
||||||
|
// Tmp test that recovers from problem with new background download code
|
||||||
|
if ( null != info && 0 == info.langCode ) {
|
||||||
|
DbgUtils.logf( "getInfo: dropping info for %s b/c lang code wrong",
|
||||||
|
dal.name );
|
||||||
|
info = null;
|
||||||
|
}
|
||||||
|
|
||||||
if ( null == info ) {
|
if ( null == info ) {
|
||||||
String[] names = { dal.name };
|
String[] names = { dal.name };
|
||||||
DictUtils.DictPairs pairs = DictUtils.openDicts( context, names );
|
DictUtils.DictPairs pairs = DictUtils.openDicts( context, names );
|
||||||
|
|
|
@ -584,11 +584,11 @@ public class GameUtils {
|
||||||
String[][] missingNames,
|
String[][] missingNames,
|
||||||
int[] missingLang )
|
int[] missingLang )
|
||||||
{
|
{
|
||||||
String[] dictNames = dictNames( context, rowid, missingLang );
|
String[] gameDicts = dictNames( context, rowid, missingLang );
|
||||||
HashSet<String> missingSet;
|
HashSet<String> missingSet;
|
||||||
DictUtils.DictAndLoc[] installed = DictUtils.dictList( context );
|
DictUtils.DictAndLoc[] installed = DictUtils.dictList( context );
|
||||||
|
|
||||||
missingSet = new HashSet<String>( Arrays.asList( dictNames ) );
|
missingSet = new HashSet<String>( Arrays.asList( gameDicts ) );
|
||||||
missingSet.remove( null );
|
missingSet.remove( null );
|
||||||
boolean allHere = 0 != missingSet.size(); // need some non-null!
|
boolean allHere = 0 != missingSet.size(); // need some non-null!
|
||||||
if ( allHere ) {
|
if ( allHere ) {
|
||||||
|
@ -596,6 +596,8 @@ public class GameUtils {
|
||||||
missingSet.remove( dal.name );
|
missingSet.remove( dal.name );
|
||||||
}
|
}
|
||||||
allHere = 0 == missingSet.size();
|
allHere = 0 == missingSet.size();
|
||||||
|
} else {
|
||||||
|
DbgUtils.logf( "gameDictsHere: game has no dicts!" );
|
||||||
}
|
}
|
||||||
if ( null != missingNames ) {
|
if ( null != missingNames ) {
|
||||||
missingNames[0] =
|
missingNames[0] =
|
||||||
|
|
|
@ -143,7 +143,9 @@ public class CurGameInfo {
|
||||||
|
|
||||||
public void setLang( int lang, String dict )
|
public void setLang( int lang, String dict )
|
||||||
{
|
{
|
||||||
|
if ( null != dict ) {
|
||||||
dictName = dict;
|
dictName = dict;
|
||||||
|
}
|
||||||
setLang( lang );
|
setLang( lang );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue