From 484ca8e1679b9658f05a9e80e38b1ac519b38709 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 22 Mar 2012 21:12:54 +0100 Subject: [PATCH] Also set the last insert filename when a project finished successfully. --- src/de/todesbaum/jsite/application/Project.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/de/todesbaum/jsite/application/Project.java b/src/de/todesbaum/jsite/application/Project.java index d09dacc..fa0b774 100644 --- a/src/de/todesbaum/jsite/application/Project.java +++ b/src/de/todesbaum/jsite/application/Project.java @@ -22,6 +22,7 @@ import java.io.File; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Map.Entry; import de.todesbaum.util.mime.DefaultMIMETypes; @@ -426,10 +427,12 @@ public class Project implements Comparable { * insert. */ public void onSuccessfulInsert() { - for (FileOption fileOption : fileOptions.values()) { - if ((fileOption.getCurrentHash() != null) && (fileOption.getCurrentHash().length() > 0) && !fileOption.getCurrentHash().equals(fileOption.getLastInsertHash())) { + for (Entry fileOptionEntry : fileOptions.entrySet()) { + FileOption fileOption = fileOptionEntry.getValue(); + if ((fileOption.getCurrentHash() != null) && (fileOption.getCurrentHash().length() > 0) && (!fileOption.getCurrentHash().equals(fileOption.getLastInsertHash()) || fileOption.isForceInsert())) { fileOption.setLastInsertEdition(edition); fileOption.setLastInsertHash(fileOption.getCurrentHash()); + fileOption.setLastInsertFilename(fileOption.hasChangedName() ? fileOption.getChangedName() : fileOptionEntry.getKey()); } fileOption.setForceInsert(false); } -- 2.7.4