mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-01 19:57:11 +01:00
don't offer to upgrade built-in wordlists
This commit is contained in:
parent
4b470f5e0f
commit
49ade38aca
1 changed files with 93 additions and 88 deletions
|
@ -1423,23 +1423,10 @@ public class DictsDelegate extends ListDelegateBase
|
|||
stopProgress();
|
||||
}
|
||||
|
||||
private boolean digestData( String jsonData )
|
||||
private Set<String> parseLangs( JSONArray langs ) throws JSONException
|
||||
{
|
||||
boolean success = false;
|
||||
JSONArray langs = null;
|
||||
|
||||
m_needUpdates = new HashMap<>();
|
||||
if ( null != jsonData ) {
|
||||
Set<String> closedLangs = new HashSet<>();
|
||||
final Set<String> curLangs =
|
||||
new HashSet<>( Arrays.asList( m_langs ) );
|
||||
|
||||
// DictLangCache hits the DB hundreds of times below. Fix!
|
||||
Log.w( TAG, "Fix me I'm stupid" );
|
||||
try {
|
||||
// Log.d( TAG, "digestData(%s)", jsonData );
|
||||
JSONObject obj = new JSONObject( jsonData );
|
||||
langs = obj.optJSONArray( "langs" );
|
||||
Set<String> curLangs = new HashSet<>( Arrays.asList( m_langs ) );
|
||||
|
||||
int nLangs = langs.length();
|
||||
m_remoteInfo = new HashMap<>();
|
||||
|
@ -1519,11 +1506,29 @@ public class DictsDelegate extends ListDelegateBase
|
|||
m_remoteInfo.put( localLangName, asArray );
|
||||
}
|
||||
}
|
||||
return closedLangs;
|
||||
}
|
||||
|
||||
private boolean digestData( String jsonData )
|
||||
{
|
||||
boolean success = false;
|
||||
// JSONArray langs = null;
|
||||
|
||||
m_needUpdates = new HashMap<>();
|
||||
if ( null != jsonData ) {
|
||||
// DictLangCache hits the DB hundreds of times below. Fix!
|
||||
Log.w( TAG, "Fix me I'm stupid" );
|
||||
try {
|
||||
Log.d( TAG, "digestData(%s)", jsonData );
|
||||
JSONObject obj = new JSONObject( jsonData );
|
||||
JSONArray langs = obj.optJSONArray( "langs" );
|
||||
if ( null != langs ) {
|
||||
Set<String> closedLangs = parseLangs( langs );
|
||||
|
||||
closedLangs.remove( m_filterLang );
|
||||
m_closedLangs.addAll( closedLangs );
|
||||
|
||||
success = true;
|
||||
}
|
||||
} catch ( JSONException ex ) {
|
||||
Log.ex( TAG, ex );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue