diff --git a/build.gradle b/build.gradle index 75145d9..e4caf62 100644 --- a/build.gradle +++ b/build.gradle @@ -26,8 +26,8 @@ android { applicationId "org.billthefarmer.editor" minSdkVersion 14 targetSdkVersion 28 - versionName "1.88" - versionCode 188 + versionName "1.89" + versionCode 189 buildConfigField "long", "BUILT", System.currentTimeMillis() + "L" } diff --git a/fastlane/metadata/android/en-GB/changelogs/189.txt b/fastlane/metadata/android/en-GB/changelogs/189.txt new file mode 100644 index 0000000..509ed1d --- /dev/null +++ b/fastlane/metadata/android/en-GB/changelogs/189.txt @@ -0,0 +1 @@ + * Fix recent file list diff --git a/src/main/java/org/billthefarmer/editor/Editor.java b/src/main/java/org/billthefarmer/editor/Editor.java index 9766290..5aec00a 100644 --- a/src/main/java/org/billthefarmer/editor/Editor.java +++ b/src/main/java/org/billthefarmer/editor/Editor.java @@ -1460,14 +1460,12 @@ private void savePath(String path) // Get a list of files List list = new ArrayList<>(); Map map = new HashMap<>(); - for (Iterator iter = pathMap.keySet().iterator(); - iter.hasNext();) + for (String name: pathMap.keySet()) { - String name = iter.next(); File file = new File(name); + // Add to remove list if non existant if (!file.exists()) { - iter.remove(); removeList.add(name); continue; } @@ -1476,6 +1474,10 @@ private void savePath(String path) map.put(file.lastModified(), name); } + // Remove non existant entries + for (String name: removeList) + pathMap.remove(name); + // Sort in reverse order Collections.sort(list); Collections.reverse(list);