QLocalServer, QLocalSocket: simpler use of startsWith()

It has a variant accepting QL1S directly, so
no need to go via a QString.

Change-Id: Ia8f1198ef2af7027bc9f7c2e1dad3a5f78a12eb4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
This commit is contained in:
Anton Kudryavtsev 2016-03-01 15:37:13 +03:00
parent 06e27b6ef9
commit 0fb7e910a9
2 changed files with 2 additions and 2 deletions

View File

@ -241,7 +241,7 @@ bool QLocalServerPrivate::listen(const QString &name)
{ {
Q_Q(QLocalServer); Q_Q(QLocalServer);
QString pipePath = QLatin1String("\\\\.\\pipe\\"); const QLatin1String pipePath("\\\\.\\pipe\\");
if (name.startsWith(pipePath)) if (name.startsWith(pipePath))
fullServerName = name; fullServerName = name;
else else

View File

@ -148,7 +148,7 @@ void QLocalSocket::connectToServer(OpenMode openMode)
return; return;
} }
QString pipePath = QLatin1String("\\\\.\\pipe\\"); const QLatin1String pipePath("\\\\.\\pipe\\");
if (d->serverName.startsWith(pipePath)) if (d->serverName.startsWith(pipePath))
d->fullServerName = d->serverName; d->fullServerName = d->serverName;
else else