mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
fix dict deletion (which broke when extension removed from
user-visible name)
This commit is contained in:
parent
84f76a8c9a
commit
70f0a5fe90
2 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue