X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fcache%2FManageCacheFunction.java;h=59ef13a9d1248eb9add927dbfe3f8ba53958a487;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hp=65565987529d3885d72a38d12a7b545317e22ed9;hpb=f1b92378a792131ac8fb33a869405851d5b2d1f7;p=GpsPrune.git diff --git a/tim/prune/function/cache/ManageCacheFunction.java b/tim/prune/function/cache/ManageCacheFunction.java index 6556598..59ef13a 100644 --- a/tim/prune/function/cache/ManageCacheFunction.java +++ b/tim/prune/function/cache/ManageCacheFunction.java @@ -365,8 +365,7 @@ public class ManageCacheFunction extends GenericFunction implements Runnable if (totalDeleted > 0) { // Show confirmation message - JOptionPane.showMessageDialog(_dialog, I18nManager.getText("dialog.diskcache.deleted1") - + " " + totalDeleted + " " + I18nManager.getText("dialog.diskcache.deleted2"), + JOptionPane.showMessageDialog(_dialog, I18nManager.getTextWithNumber("dialog.diskcache.deleted", totalDeleted), I18nManager.getText(getNameKey()), JOptionPane.INFORMATION_MESSAGE); // reload model _cards.first(_cardPanel); @@ -395,18 +394,13 @@ public class ManageCacheFunction extends GenericFunction implements Runnable if (subdir.isDirectory()) { numDeleted += deleteFilesFrom(subdir, inMaxDays); } - else if (subdir.isFile() && subdir.exists()) + else if (subdir.isFile() && subdir.exists() && _TILEFILTER.accept(subdir)) { - boolean isTileFile = _TILEFILTER.accept(subdir); - boolean isBadFile = !isTileFile && subdir.getName().toLowerCase().endsWith("png"); - if (isTileFile || isBadFile) + long fileAge = (now - subdir.lastModified()) / 1000 / 60 / 60 / 24; + if (inMaxDays < 0 || fileAge > inMaxDays) { - long fileAge = (now - subdir.lastModified()) / 1000 / 60 / 60 / 24; - if (inMaxDays < 0 || fileAge > inMaxDays || isBadFile) - { - if (subdir.delete()) { - numDeleted++; - } + if (subdir.delete()) { + numDeleted++; } } }