mirror of
https://github.com/jamessanford/kegs.git
synced 2024-06-07 16:03:45 +00:00
Manually add built-in assets to disk image list, they may not exist on startup.
This commit is contained in:
parent
6a6b104d5e
commit
1e41eab9bf
|
@ -41,6 +41,17 @@ class AssetImages extends AsyncTask<Void, Void, Boolean> {
|
||||||
checkOldImagePath("System 6.hdv");
|
checkOldImagePath("System 6.hdv");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isAssetFilename(final String filename) {
|
||||||
|
// We have to ignore any temporary files that we are working on, too.
|
||||||
|
if (filename.equals("System 6.hdv") ||
|
||||||
|
filename.equals("XMAS_DEMO.2MG") ||
|
||||||
|
filename.equals("tmp_System 6.hdv") ||
|
||||||
|
filename.equals("tmp_XMAS_DEMO.2MG")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static String translateTitle(final String title) {
|
public static String translateTitle(final String title) {
|
||||||
if (title.equals("System 6.hdv")) {
|
if (title.equals("System 6.hdv")) {
|
||||||
return "System 6";
|
return "System 6";
|
||||||
|
|
|
@ -51,7 +51,11 @@ public class DiskImageFragment extends SherlockDialogFragment {
|
||||||
String[] files = new File(dir).list();
|
String[] files = new File(dir).list();
|
||||||
if (files != null) {
|
if (files != null) {
|
||||||
for (String filename : files) {
|
for (String filename : files) {
|
||||||
if (!filename.startsWith(".") && DiskImage.isDiskImageFilename(filename)) {
|
// NOTE: Checking each filename against the known asset image names
|
||||||
|
// is a bit silly.
|
||||||
|
if (!filename.startsWith(".") &&
|
||||||
|
DiskImage.isDiskImageFilename(filename) &&
|
||||||
|
!AssetImages.isAssetFilename(filename)) {
|
||||||
final DiskImage image = DiskImage.fromPath(dir + "/" + filename);
|
final DiskImage image = DiskImage.fromPath(dir + "/" + filename);
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
mFoundImages.add(image);
|
mFoundImages.add(image);
|
||||||
|
@ -60,6 +64,9 @@ public class DiskImageFragment extends SherlockDialogFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// NOTE HACK. These files may not exist yet, so we cannot use fromPath.
|
||||||
|
mFoundImages.add(new DiskImage("System 6.hdv", "s7d1", 3, DiskImage.BOOT_SLOT_7, DiskImage.ASSET));
|
||||||
|
mFoundImages.add(new DiskImage("XMAS_DEMO.2MG", "s5d1", 2, DiskImage.BOOT_SLOT_5, DiskImage.ASSET));
|
||||||
Collections.sort(mFoundImages);
|
Collections.sort(mFoundImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user