Auflösen von Pfaden verbessert
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -86,32 +86,41 @@ public class Worker {
|
||||
int year = 1900+date.getYear();
|
||||
int month = date.getMonth()+1;
|
||||
int day = date.getDate();
|
||||
resolvedPath = rawPath.replace("$"+t("HOME"),HOME)
|
||||
.replace("$"+t("PROFILE"), profile)
|
||||
.replace("$"+t("YEAR"), year+"")
|
||||
.replace("$"+t("MONTH"), month<10 ? "0"+month : ""+month)
|
||||
.replace("$"+t("Month"),monthName(month))
|
||||
.replace("$"+t("month"),monthName(month).toLowerCase())
|
||||
.replace("$"+t("Mon"),monthNameShort(month))
|
||||
.replace("$"+t("mon"),monthNameShort(month).toLowerCase())
|
||||
.replace("$"+t("DAY"), day < 10 ? "0"+day : ""+day);
|
||||
|
||||
var start = resolvedPath.indexOf("$");
|
||||
toolbar.resetAdditionalFields();
|
||||
while (start>-1) {
|
||||
var end = endOfVar(resolvedPath, start+1);
|
||||
if (end>start+1){
|
||||
var variable = resolvedPath.substring(start+1, end);
|
||||
LOG.debug("…unresolved '{}'",variable);
|
||||
var value = PAGE.equals(variable) ? "["+variable+"]":toolbar.requireField(variable);
|
||||
variable = "$"+variable;
|
||||
LOG.debug("replacing '{}' in '{}' by '{}'",variable,resolvedPath,value);
|
||||
resolvedPath = resolvedPath.replace(variable,value);
|
||||
start = resolvedPath.indexOf("$",start+1);
|
||||
} else {
|
||||
start = resolvedPath.indexOf("$",start+2);
|
||||
resolvedPath = rawPath;
|
||||
var last = "";
|
||||
var iter = 0;
|
||||
do {
|
||||
last = resolvedPath;
|
||||
LOG.debug("Starting iteration {}: {}",++iter,resolvedPath);
|
||||
resolvedPath = resolvedPath.replace("$" + t("HOME"), HOME)
|
||||
.replace("$" + t("PROFILE"), profile)
|
||||
.replace("$" + t("YEAR"), year + "")
|
||||
.replace("$" + t("MONTH"), month < 10 ? "0" + month : "" + month)
|
||||
.replace("$" + t("Month"), monthName(month))
|
||||
.replace("$" + t("month"), monthName(month).toLowerCase())
|
||||
.replace("$" + t("Mon"), monthNameShort(month))
|
||||
.replace("$" + t("mon"), monthNameShort(month).toLowerCase())
|
||||
.replace("$" + t("DAY"), day < 10 ? "0" + day : "" + day);
|
||||
|
||||
var start = resolvedPath.indexOf("$");
|
||||
if (start > -1) {
|
||||
var end = endOfVar(resolvedPath, start + 1);
|
||||
if (end > start + 1) {
|
||||
var variable = resolvedPath.substring(start + 1, end);
|
||||
LOG.debug("…unresolved '{}'", variable);
|
||||
var value = PAGE.equals(variable) ? "[" + variable + "]" : toolbar.requireField(variable);
|
||||
variable = "$" + variable;
|
||||
LOG.debug("replacing '{}' in '{}' by '{}'", variable, resolvedPath, value);
|
||||
resolvedPath = resolvedPath.replace(variable, value);
|
||||
start = resolvedPath.indexOf("$", start + 1);
|
||||
} else {
|
||||
start = resolvedPath.indexOf("$", start + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG.debug("Iteration {} ended: {}",iter,resolvedPath);
|
||||
} while (!last.equals(resolvedPath));
|
||||
LOG.debug("result: {}",resolvedPath);
|
||||
toolbar.dropUnusedAdditionalFields();
|
||||
statusBar.setPath(resolvedPath+"."+extension());
|
||||
mainFrame.pack();
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
|
||||
<logger name="de.srsoftware.belegscanner.Worker" level="debug" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
|
||||
<root level="error">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
|
||||
@@ -28,6 +28,7 @@ January : Januar
|
||||
Joining PDFs… : Verbinde PDFs…
|
||||
join PDFs : PDFs binden
|
||||
July : Juli
|
||||
June : Juni
|
||||
Language support : Sprach-Unterstützung
|
||||
May : Mai
|
||||
March : März
|
||||
|
||||
Reference in New Issue
Block a user