Port QtPrintSupport to QStringView

Task-number: QTBUG-84319
Change-Id: I4a2407dcf1c2979cd109e7cb3dd7d6395c56b927
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Lars Knoll 2020-05-27 13:08:49 +02:00
parent 5c4f470132
commit 60f83a7675
2 changed files with 2 additions and 2 deletions

View File

@ -249,7 +249,7 @@ void QCupsPrintEnginePrivate::closePrintDevice()
// Print the file // Print the file
// Cups expect the printer original name without instance, the full name is used only to retrieve the configuration // Cups expect the printer original name without instance, the full name is used only to retrieve the configuration
const auto parts = printerName.splitRef(QLatin1Char('/')); const auto parts = QStringView{printerName}.split(QLatin1Char('/'));
const auto printerOriginalName = parts.at(0); const auto printerOriginalName = parts.at(0);
cups_option_t* optPtr = cupsOptStruct.size() ? &cupsOptStruct.first() : 0; cups_option_t* optPtr = cupsOptStruct.size() ? &cupsOptStruct.first() : 0;
cupsPrintFile(printerOriginalName.toLocal8Bit().constData(), tempFile.toLocal8Bit().constData(), cupsPrintFile(printerOriginalName.toLocal8Bit().constData(), tempFile.toLocal8Bit().constData(),

View File

@ -60,7 +60,7 @@ QPpdPrintDevice::QPpdPrintDevice(const QString &id)
if (!id.isEmpty()) { if (!id.isEmpty()) {
// TODO For now each dest is an individual device // TODO For now each dest is an individual device
const auto parts = id.splitRef(QLatin1Char('/')); const auto parts = QStringView{id}.split(QLatin1Char('/'));
m_cupsName = parts.at(0).toUtf8(); m_cupsName = parts.at(0).toUtf8();
if (parts.size() > 1) if (parts.size() > 1)
m_cupsInstance = parts.at(1).toUtf8(); m_cupsInstance = parts.at(1).toUtf8();