summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-14 14:38:34 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-04-19 19:40:04 +0200
commit42c8f56acc12f3cba5b9ff093ad4232b127f8b26 (patch)
treef8ab10caab1af343d16c178485c3b93f4e30069b /src/printsupport/kernel
parent24d2a00ce2b2983655e9c59705025218cd0fa345 (diff)
Printsupport: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434 Change-Id: I415132ed381c25313e7fcccd050e522667eb6c22 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r--src/printsupport/kernel/qcups.cpp28
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.cpp4
-rw-r--r--src/printsupport/kernel/qprinter.cpp4
3 files changed, 21 insertions, 15 deletions
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index c1af1f19a9..09b8388866 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -44,6 +44,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
QT_IMPL_METATYPE_EXTERN_TAGGED(QCUPSSupport::JobHoldUntil,
QCUPSSupport__JobHoldUntil)
QT_IMPL_METATYPE_EXTERN_TAGGED(QCUPSSupport::BannerPage,
@@ -129,17 +131,17 @@ static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold,
QCUPSSupport::JobHoldUntilWithTime QCUPSSupport::parseJobHoldUntil(const QString &jobHoldUntil)
{
- if (jobHoldUntil == QLatin1String("indefinite")) {
+ if (jobHoldUntil == "indefinite"_L1) {
return { QCUPSSupport::Indefinite, QTime() };
- } else if (jobHoldUntil == QLatin1String("day-time")) {
+ } else if (jobHoldUntil == "day-time"_L1) {
return { QCUPSSupport::DayTime, QTime() };
- } else if (jobHoldUntil == QLatin1String("night")) {
+ } else if (jobHoldUntil == "night"_L1) {
return { QCUPSSupport::Night, QTime() };
- } else if (jobHoldUntil == QLatin1String("second-shift")) {
+ } else if (jobHoldUntil == "second-shift"_L1) {
return { QCUPSSupport::SecondShift, QTime() };
- } else if (jobHoldUntil == QLatin1String("third-shift")) {
+ } else if (jobHoldUntil == "third-shift"_L1) {
return { QCUPSSupport::ThirdShift, QTime() };
- } else if (jobHoldUntil == QLatin1String("weekend")) {
+ } else if (jobHoldUntil == "weekend"_L1) {
return { QCUPSSupport::Weekend, QTime() };
}
@@ -216,13 +218,13 @@ static inline QString bannerPageToString(const QCUPSSupport::BannerPage bannerPa
static inline QCUPSSupport::BannerPage stringToBannerPage(const QString &bannerPage)
{
- if (bannerPage == QLatin1String("none")) return QCUPSSupport::NoBanner;
- else if (bannerPage == QLatin1String("standard")) return QCUPSSupport::Standard;
- else if (bannerPage == QLatin1String("unclassified")) return QCUPSSupport::Unclassified;
- else if (bannerPage == QLatin1String("confidential")) return QCUPSSupport::Confidential;
- else if (bannerPage == QLatin1String("classified")) return QCUPSSupport::Classified;
- else if (bannerPage == QLatin1String("secret")) return QCUPSSupport::Secret;
- else if (bannerPage == QLatin1String("topsecret")) return QCUPSSupport::TopSecret;
+ if (bannerPage == "none"_L1) return QCUPSSupport::NoBanner;
+ else if (bannerPage == "standard"_L1) return QCUPSSupport::Standard;
+ else if (bannerPage == "unclassified"_L1) return QCUPSSupport::Unclassified;
+ else if (bannerPage == "confidential"_L1) return QCUPSSupport::Confidential;
+ else if (bannerPage == "classified"_L1) return QCUPSSupport::Classified;
+ else if (bannerPage == "secret"_L1) return QCUPSSupport::Secret;
+ else if (bannerPage == "topsecret"_L1) return QCUPSSupport::TopSecret;
return QCUPSSupport::NoBanner;
}
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp
index 6f470b835c..6e2a76ebb2 100644
--- a/src/printsupport/kernel/qplatformprintplugin.cpp
+++ b/src/printsupport/kernel/qplatformprintplugin.cpp
@@ -48,6 +48,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
#if defined(Q_OS_MACOS)
Q_IMPORT_PLUGIN(QCocoaPrinterSupportPlugin)
#elif defined(Q_OS_WIN)
@@ -55,7 +57,7 @@ Q_IMPORT_PLUGIN(QWindowsPrinterSupportPlugin)
#endif
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QPlatformPrinterSupportFactoryInterface_iid, QLatin1String("/printsupport"), Qt::CaseInsensitive))
+ (QPlatformPrinterSupportFactoryInterface_iid, "/printsupport"_L1, Qt::CaseInsensitive))
QPlatformPrinterSupportPlugin::QPlatformPrinterSupportPlugin(QObject *parent)
: QObject(parent)
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index d320accad0..08cbdac05c 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -61,6 +61,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
#define ABORT_IF_ACTIVE(location) \
if (d->printEngine->printerState() == QPrinter::Active) { \
qWarning("%s: Cannot be changed while printer is active", location); \
@@ -749,7 +751,7 @@ void QPrinter::setOutputFileName(const QString &fileName)
ABORT_IF_ACTIVE("QPrinter::setOutputFileName");
QFileInfo fi(fileName);
- if (!fi.suffix().compare(QLatin1String("pdf"), Qt::CaseInsensitive))
+ if (!fi.suffix().compare("pdf"_L1, Qt::CaseInsensitive))
setOutputFormat(QPrinter::PdfFormat);
else if (fileName.isEmpty())
setOutputFormat(QPrinter::NativeFormat);