From 816a1df45a059789d7a4dd079e44d2a130e8235a Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 15 Jun 2020 12:30:36 +0200 Subject: [PATCH] Debugger: Remove one use of QStringRef This is a guinea pig to check whether using u"..." is ok nowadays. Change-Id: I402816d8892211e67fb6227cd0441c20c0b33818 Reviewed-by: Christian Stenger Reviewed-by: Oliver Wolff Reviewed-by: Eike Ziller --- src/plugins/debugger/gdb/gdbengine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 14565da5860..11bab647d02 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -95,12 +95,12 @@ static int ¤tToken() return token; } -static bool isMostlyHarmlessMessage(const QStringRef &msg) +static bool isMostlyHarmlessMessage(const QStringView msg) { - return msg == "warning: GDB: Failed to set controlling terminal: " - "Inappropriate ioctl for device\\n" - || msg == "warning: GDB: Failed to set controlling terminal: " - "Invalid argument\\n"; + return msg == u"warning: GDB: Failed to set controlling terminal: " + "Inappropriate ioctl for device\\n" + || msg == u"warning: GDB: Failed to set controlling terminal: " + "Invalid argument\\n"; } static QMessageBox *showMessageBox(QMessageBox::Icon icon, @@ -605,7 +605,7 @@ void GdbEngine::readDebuggeeOutput(const QByteArray &ba) const QString msg = m_inferiorOutputCodec->toUnicode(ba.constData(), ba.size(), &m_inferiorOutputCodecState); - if (msg.startsWith("&\"") && isMostlyHarmlessMessage(msg.midRef(2, msg.size() - 4))) + if (msg.startsWith("&\"") && isMostlyHarmlessMessage(QStringView{msg}.mid(2, msg.size() - 4))) showMessage("Mostly harmless terminal warning suppressed.", LogWarning); else showMessage(msg, AppStuff);