Don't use automatic string conversions
* Disables automatic conversions from 8-bit strings (char *) to unicode QStrings. * Disables automatic conversion from QString to 8-bit strings (char *). * Disables automatic conversions from QByteArray to const char * or const void *. * Disables automatic conversions from QString (or char *) to QUrl. * Use QStringBuilder for more efficient string creation. It make us aware of string and encoding conversions.
This commit is contained in:
committed by
Chih-Hsuan Yen
parent
e3adf1abe2
commit
c6880070e9
+2
-2
@@ -73,7 +73,7 @@ Emulation::Emulation() :
|
||||
SLOT(bracketedPasteModeChanged(bool)));
|
||||
|
||||
connect(this, &Emulation::cursorChanged, [this] (KeyboardCursorShape cursorShape, bool blinkingCursorEnabled) {
|
||||
emit titleChanged( 50, QString("CursorShape=%1;BlinkingCursorEnabled=%2")
|
||||
emit titleChanged( 50, QString(QLatin1String("CursorShape=%1;BlinkingCursorEnabled=%2"))
|
||||
.arg(static_cast<int>(cursorShape)).arg(blinkingCursorEnabled) );
|
||||
});
|
||||
}
|
||||
@@ -214,7 +214,7 @@ void Emulation::sendKeyEvent( QKeyEvent* ev )
|
||||
{ // A block of text
|
||||
// Note that the text is proper unicode.
|
||||
// We should do a conversion here
|
||||
emit sendData(ev->text().toUtf8(),ev->text().length());
|
||||
emit sendData(ev->text().toUtf8().constData(),ev->text().length());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user