Skip to content

Commit 208ee1d

Browse files
committed
Fix remote debugging launch prompt
1 parent ed50c40 commit 208ee1d

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

ui/controlswidget.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,7 @@ void DebugControlsWidget::performLaunch()
181181
isLocalLaunch = false;
182182
}
183183

184-
// Also consider debug server connections as remote
185-
if (m_controller->IsConnectedToDebugServer())
186-
{
187-
isLocalLaunch = false;
188-
}
184+
bool connectedToDebugServer = m_controller->IsConnectedToDebugServer();
189185

190186
if (isLocalLaunch && firstLaunch && Settings::Instance()->Get<bool>("debugger.confirmFirstLaunch"))
191187
{
@@ -194,7 +190,8 @@ void DebugControlsWidget::performLaunch()
194190
if (QMessageBox::question(this, "Launch Target", prompt) != QMessageBox::Yes)
195191
return;
196192
}
197-
else if (!isLocalLaunch && firstLaunch && Settings::Instance()->Get<bool>("debugger.confirmFirstLaunch"))
193+
else if (!isLocalLaunch && connectedToDebugServer &&firstLaunch &&
194+
Settings::Instance()->Get<bool>("debugger.confirmFirstLaunch"))
198195
{
199196
auto remoteHost = QString::fromStdString(m_controller->GetRemoteHost());
200197
auto remotePort = m_controller->GetRemotePort();

ui/ui.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,7 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context)
477477
isLocalLaunch = false;
478478
}
479479

480-
// Also consider debug server connections as remote
481-
if (controller->IsConnectedToDebugServer())
482-
{
483-
isLocalLaunch = false;
484-
}
480+
bool connectedToDebugServer = controller->IsConnectedToDebugServer();
485481

486482
if (isLocalLaunch && firstLaunch && Settings::Instance()->Get<bool>("debugger.confirmFirstLaunch"))
487483
{
@@ -491,7 +487,8 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context)
491487
if (QMessageBox::question(context->mainWindow(), "Launch Target", prompt) != QMessageBox::Yes)
492488
return;
493489
}
494-
else if (!isLocalLaunch && firstLaunch && Settings::Instance()->Get<bool>("debugger.confirmFirstLaunch"))
490+
else if (!isLocalLaunch && connectedToDebugServer && firstLaunch &&
491+
Settings::Instance()->Get<bool>("debugger.confirmFirstLaunch"))
495492
{
496493
auto remoteHost = QString::fromStdString(controller->GetRemoteHost());
497494
auto remotePort = controller->GetRemotePort();

0 commit comments

Comments
 (0)