ibus: Make address a QByteArray instead of a view in createConnection()
When "address" is a QBAV, it points to line(QBAV) which points to lineArray(QBA), so its data will be overwitten after every read: while(file.readLineInto(&lineArray)) This amends f0aa391ef89a393221d77d5ad3c1616a4727f11a . Fixes: QTBUG-133445 Change-Id: Id23e726327529c44e205c4c0720af0dad42c175b Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 07eeb45d881bb0240e472167217912b08be44371) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
c04a7aa2c6
commit
7a2b93fc78
@ -774,7 +774,7 @@ void QIBusPlatformInputContextPrivate::createConnection()
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
return;
|
||||
|
||||
QByteArrayView address;
|
||||
QByteArray address;
|
||||
int pid = -1;
|
||||
QByteArray lineArray;
|
||||
|
||||
@ -784,7 +784,7 @@ void QIBusPlatformInputContextPrivate::createConnection()
|
||||
continue;
|
||||
|
||||
if (line.startsWith("IBUS_ADDRESS="))
|
||||
address = line.mid(sizeof("IBUS_ADDRESS=") - 1);
|
||||
address = line.mid(sizeof("IBUS_ADDRESS=") - 1).toByteArray();
|
||||
if (line.startsWith("IBUS_DAEMON_PID="))
|
||||
pid = line.mid(sizeof("IBUS_DAEMON_PID=") - 1).toInt();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user