From 61fcad2c1495d38540fa2e807e5e8b54b1b1c3c8 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Wed, 31 Dec 2025 10:10:48 -0500 Subject: [PATCH] refactor: MainWindow::updateIpLabel, remove single use vars --- src/lib/gui/MainWindow.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/gui/MainWindow.cpp b/src/lib/gui/MainWindow.cpp index a8ecddc4c..be2f98513 100644 --- a/src/lib/gui/MainWindow.cpp +++ b/src/lib/gui/MainWindow.cpp @@ -1281,8 +1281,6 @@ void MainWindow::updateIpLabel(const QList &addresses) labelText = tr("Suggested IP: "); toolTipText = tr("

If connecting via the hostname fails, try %1

"); - static auto s_toolTipSuggestIP = tr("the suggested IP."); - static auto s_toolTipIpList = tr("one of the following IPs:
%1"); // Determine which IP to show and tooltip based on server state if (m_coreProcess.isStarted()) { @@ -1316,14 +1314,13 @@ void MainWindow::updateIpLabel(const QList &addresses) } else { // Server is not running - update normally m_currentIpAddress = m_networkMonitor->getSuggestedIPv4Address(); - QString displayIP = m_currentIpAddress.isNull() ? m_currentIpAddress.toString() : ipList.first(); - labelText.append(displayIP); + labelText.append(m_currentIpAddress.isNull() ? m_currentIpAddress.toString() : ipList.first()); } if (ipList.count() < 2) { - toolTipText = toolTipText.arg(s_toolTipSuggestIP); + toolTipText = toolTipText.arg(tr("the suggested IP.")); } else { - toolTipText = toolTipText.arg(s_toolTipIpList.arg(ipList.join("
"))); + toolTipText = toolTipText.arg(tr("one of the following IPs:
%1").arg(ipList.join("
"))); } ui->lblIpAddresses->setText(labelText);