Hide the default port in bookmark lists

Bookmark.hostPort gives the address alone for port 9987 and address:port
otherwise. The Android connect screen, the myTeamSpeak item lists on
desktop and Android, and the display name of an unnamed bookmark use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 15:29:42 +00:00
co-authored by Claude Opus 5.5
parent 455fc514f5
commit b586a80a14
5 changed files with 42 additions and 6 deletions
@@ -2,6 +2,7 @@ package eu.lixko.ts3j.client.ui;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.formdev.flatlaf.util.UIScale;
import eu.lixko.ts3j.client.config.Bookmark;
import eu.lixko.ts3j.client.myts.AccountInfo;
import eu.lixko.ts3j.client.myts.MyTeamSpeak;
import eu.lixko.ts3j.client.myts.MyTeamSpeakLogin;
@@ -416,7 +417,7 @@ final class MyTeamSpeakPanel extends JPanel {
default -> "";
};
case 2 -> switch (r.item()) {
case SyncItem.Bookmark b -> b.address() + ":" + b.port();
case SyncItem.Bookmark b -> Bookmark.hostPort(b.address(), b.port());
case SyncItem.Identity i -> i.nickname();
default -> "";
};