fix dict deletion (which broke when extension removed from

user-visible name)
This commit is contained in:
eehouse 2010-05-20 04:29:10 +00:00
parent 84f76a8c9a
commit 70f0a5fe90
2 changed files with 9 additions and 1 deletions

View file

@ -116,7 +116,7 @@ public class DictsActivity extends ListActivity
editor.commit();
break;
case R.id.dicts_item_delete:
deleteFile( m_dicts[info.position] );
GameUtils.deleteDict( this, m_dicts[info.position] );
mkListAdapter();
handled = true;
break;

View file

@ -234,6 +234,14 @@ public class GameUtils {
return al.toArray( new String[al.size()] );
}
public static void deleteDict( Context context, String name )
{
if ( ! name.endsWith( XWConstants.DICT_EXTN ) ) {
name += XWConstants.DICT_EXTN;
}
context.deleteFile( name );
}
public static byte[] openDict( Context context, String name )
{
byte[] bytes = null;