Don't show save files in ROM browser.

This commit is contained in:
Themaister 2012-12-31 20:48:52 +01:00
parent ca2e6c3e24
commit be5c271b0e
3 changed files with 14 additions and 3 deletions

View File

@ -21,6 +21,7 @@
android:key="video_force_aspect"
android:summary="Let game decide aspect ratio"
android:title="Force aspect correction" />
</PreferenceScreen>
<PreferenceScreen android:title="Audio Config" >

View File

@ -200,8 +200,18 @@ public class DirectoryActivity extends Activity implements
final File[] files = listedDirectory.listFiles();
if (files != null) {
for (File file : files) {
adapter.add(new FileWrapper(file, false,
file.isDirectory() || true));
String path = file.getName();
boolean isRomFile = !path.endsWith(".srm")
&& !path.endsWith(".state")
&& !path.contains(".state.auto")
&& !path.endsWith(".rtc");
// Don't list save files in ROM list.
if (isRomFile) {
adapter.add(new FileWrapper(file, false,
file.isDirectory() || true));
}
}
}

View File

@ -132,7 +132,7 @@ public class ModuleActivity extends Activity implements
}
private void updateConfigFile() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
config.setBoolean("video_force_aspect", prefs.getBoolean("video_force_aspect", true));
config.setBoolean("audio_rate_control", prefs.getBoolean("audio_rate_control", true));
config.setBoolean("audio_enable", prefs.getBoolean("audio_enable", true));