forked from qt-creator/qt-creator
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 <christian.stenger@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -95,12 +95,12 @@ static int ¤tToken()
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isMostlyHarmlessMessage(const QStringRef &msg)
|
static bool isMostlyHarmlessMessage(const QStringView msg)
|
||||||
{
|
{
|
||||||
return msg == "warning: GDB: Failed to set controlling terminal: "
|
return msg == u"warning: GDB: Failed to set controlling terminal: "
|
||||||
"Inappropriate ioctl for device\\n"
|
"Inappropriate ioctl for device\\n"
|
||||||
|| msg == "warning: GDB: Failed to set controlling terminal: "
|
|| msg == u"warning: GDB: Failed to set controlling terminal: "
|
||||||
"Invalid argument\\n";
|
"Invalid argument\\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static QMessageBox *showMessageBox(QMessageBox::Icon icon,
|
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(),
|
const QString msg = m_inferiorOutputCodec->toUnicode(ba.constData(), ba.size(),
|
||||||
&m_inferiorOutputCodecState);
|
&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);
|
showMessage("Mostly harmless terminal warning suppressed.", LogWarning);
|
||||||
else
|
else
|
||||||
showMessage(msg, AppStuff);
|
showMessage(msg, AppStuff);
|
||||||
|
Reference in New Issue
Block a user