Remove files from the file history which are not existing anymore.

This commit is contained in:
hneemann 2017-03-10 21:18:24 +01:00
parent 363dfab98a
commit dc8fb35ecd
2 changed files with 6 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import java.util.*;
import static de.neemann.digital.analyse.expression.Operation.or; import static de.neemann.digital.analyse.expression.Operation.or;
/** /**
* The algorithm from Quine and McCluskey * The algorithm of Quine and McCluskey
* *
* @author hneemann * @author hneemann
*/ */

View File

@ -34,8 +34,11 @@ public final class FileHistory {
files = new ArrayList<File>(); files = new ArrayList<File>();
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
String pathname = PREFS.get(FILE_NAME + i, null); String pathname = PREFS.get(FILE_NAME + i, null);
if (pathname != null && pathname.length() > 0) if (pathname != null && pathname.length() > 0) {
files.add(new File(pathname)); final File file = new File(pathname);
if (file.exists())
files.add(file);
}
} }
if (n != files.size()) if (n != files.size())
saveEntries(); saveEntries();