Skip to content

Commit

Permalink
front: Fix default data path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fzurita committed Mar 22, 2016
1 parent 5b6a920 commit dda18a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/paulscode/android/mupen64plusae/SplashActivity.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import paulscode.android.mupen64plusae.dialog.Popups; import paulscode.android.mupen64plusae.dialog.Popups;
import paulscode.android.mupen64plusae.persistent.AppData; import paulscode.android.mupen64plusae.persistent.AppData;
import paulscode.android.mupen64plusae.persistent.GlobalPrefs; import paulscode.android.mupen64plusae.persistent.GlobalPrefs;
import paulscode.android.mupen64plusae.preference.PathPreference;
import paulscode.android.mupen64plusae.preference.PrefUtil; import paulscode.android.mupen64plusae.preference.PrefUtil;
import paulscode.android.mupen64plusae.task.ExtractAssetsTask; import paulscode.android.mupen64plusae.task.ExtractAssetsTask;
import paulscode.android.mupen64plusae.task.ExtractAssetsTask.ExtractAssetsListener; import paulscode.android.mupen64plusae.task.ExtractAssetsTask.ExtractAssetsListener;
Expand Down Expand Up @@ -154,10 +155,13 @@ public void onCreate( Bundle savedInstanceState )
//Check for invalid data path //Check for invalid data path
String dataPathString = mPrefs.getString( DATA_PATH, null ); 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 ); 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 // @formatter:on
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private void populate( String path )
FileUtil.populate( startPath, true, true, isFilesIncluded, mNames, mPaths ); FileUtil.populate( startPath, true, true, isFilesIncluded, mNames, mPaths );
} }


private static String validate( String value ) public static String validate( String value )
{ {
if( TextUtils.isEmpty( value ) ) if( TextUtils.isEmpty( value ) )
{ {
Expand Down

0 comments on commit dda18a2

Please sign in to comment.