allow short wallet display name retrieval

This commit is contained in:
Craig Raw 2022-01-31 19:12:36 +02:00
parent 61317f15ac
commit 9618c73c50

View file

@ -73,7 +73,7 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
return childWallets.isEmpty() ? name : name + "-" + (label != null && !label.isEmpty() ? label : getAutomaticName()); return childWallets.isEmpty() ? name : name + "-" + (label != null && !label.isEmpty() ? label : getAutomaticName());
} }
return getMasterWallet().getName() + "-" + getDisplayName(this); return getMasterWallet().getName() + "-" + getDisplayName();
} }
public String getFullDisplayName() { public String getFullDisplayName() {
@ -81,11 +81,11 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
return childWallets.isEmpty() ? name : name + " - " + (label != null && !label.isEmpty() ? label : getAutomaticName()); return childWallets.isEmpty() ? name : name + " - " + (label != null && !label.isEmpty() ? label : getAutomaticName());
} }
return getMasterWallet().getName() + " - " + getDisplayName(this); return getMasterWallet().getName() + " - " + getDisplayName();
} }
private String getDisplayName(Wallet wallet) { public String getDisplayName() {
return wallet.label != null && !wallet.label.isEmpty() ? wallet.label : wallet.name; return label != null && !label.isEmpty() ? label : (isMasterWallet() ? getAutomaticName() : name);
} }
public String getAutomaticName() { public String getAutomaticName() {