From c0d2295d4e84c3d930c8050ae0531a60a75784c3 Mon Sep 17 00:00:00 2001 From: Nitch2024 Date: Sun, 30 Mar 2025 00:50:21 -0700 Subject: [PATCH] Fixed string generation to fit better within codebase as suggested by TryTwo --- Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index 1bfbe829f4..de082a289f 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -831,14 +831,12 @@ void CodeViewWidget::OnCopyWholeLine() { const u32 addr = GetContextAddress(); - const QString textAddress = QStringLiteral("%1").arg(addr, 8, 16, QLatin1Char('0')); - const std::string textCode = [this, addr] { Core::CPUThreadGuard guard(m_system); return m_system.GetPowerPC().GetDebugInterface().Disassemble(&guard, addr); }(); - QString textTarget = QStringLiteral(""); + std::string wholeLineText = std::format("{:08x} {}", addr, textCode); if (IsInstructionLoadStore(textCode)) { @@ -847,13 +845,11 @@ void CodeViewWidget::OnCopyWholeLine() if (target_addr) { - textTarget = QStringLiteral(" targetting ") + - QStringLiteral("%1").arg(*target_addr, 8, 16, QLatin1Char('0')); + wholeLineText += std::format(" targetting {:08x}", *target_addr); } } - QApplication::clipboard()->setText(textAddress + QString::fromStdString(std::string(" ")) + - QString::fromStdString(textCode) + textTarget); + QApplication::clipboard()->setText(QString::fromStdString(wholeLineText)); } void CodeViewWidget::OnCopyFunction()