qprintdialog_unix: small optimization, no need to extract a substring

Change-Id: Ie5fdfd6aa3866c14b6fbfabf4533327f5c73c5a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
David Faure 2015-07-31 14:16:53 +02:00 committed by Marc Mutz
parent 5919edc523
commit ee8c09f7c2

View File

@ -805,7 +805,7 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties()
home += QLatin1Char('/');
if (!cur.isEmpty() && cur.at(cur.length()-1) != QLatin1Char('/'))
cur += QLatin1Char('/');
if (cur.left(home.length()) != home)
if (!cur.startsWith(home))
cur = home;
if (QGuiApplication::platformName() == QLatin1String("xcb")) {
if (printer->docName().isEmpty()) {