Permalink
Browse files

front: Fix default data path issues

  • Loading branch information...
fzurita committed Mar 22, 2016
1 parent 5b6a920 commit dda18a29cc74654a931e9073e4a35da7fc498526
@@ -29,6 +29,7 @@
import paulscode.android.mupen64plusae.dialog.Popups;
import paulscode.android.mupen64plusae.persistent.AppData;
import paulscode.android.mupen64plusae.persistent.GlobalPrefs;
import paulscode.android.mupen64plusae.preference.PathPreference;
import paulscode.android.mupen64plusae.preference.PrefUtil;
import paulscode.android.mupen64plusae.task.ExtractAssetsTask;
import paulscode.android.mupen64plusae.task.ExtractAssetsTask.ExtractAssetsListener;
@@ -154,10 +155,13 @@ public void onCreate( Bundle savedInstanceState )
//Check for invalid data path
String dataPathString = mPrefs.getString( DATA_PATH, null );
if(dataPathString == null || dataPathString.isEmpty())
if(dataPathString == null || dataPathString.isEmpty() ||
dataPathString.contains(res.getString(R.string.pathGameSaves_default)))
{
String defValue = res.getString( R.string.pathGameSaves_default );
mPrefs.edit().putString( DATA_PATH, defValue ).commit();
String newDefValue = PathPreference.validate( defValue);
mPrefs.edit().putString( DATA_PATH, newDefValue ).commit();
}
// @formatter:on
@@ -274,7 +274,7 @@ private void populate( String path )
FileUtil.populate( startPath, true, true, isFilesIncluded, mNames, mPaths );
}
private static String validate( String value )
public static String validate( String value )
{
if( TextUtils.isEmpty( value ) )
{

0 comments on commit dda18a2

Please sign in to comment.