summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-13 11:42:38 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-05-04 10:00:35 +0200
commitceaa7d6341e666f6fe0d071ea34cad9877961a0e (patch)
tree7280a74e2e0e498720dcd141ac4f759df766a669 /src/plugins/platforms/eglfs
parent5020d1b22a31f5fe45287547037c57fa5aeb06d7 (diff)
Plugins: use _L1 for for creating Latin-1 string literals
As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I7fadd3cf27ad099028d70f05956303e3af62c0f5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscursor.cpp8
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp6
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp12
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp32
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp8
-rw-r--r--src/plugins/platforms/eglfs/qeglfsmain.cpp4
6 files changed, 41 insertions, 29 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp
index 29b15e5926..63fac24cfc 100644
--- a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp
@@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
QEglFSCursor::QEglFSCursor(QPlatformScreen *screen)
: m_visible(true),
m_screen(static_cast<QEglFSScreen *>(screen)),
@@ -178,14 +180,14 @@ void QEglFSCursor::initCursorAtlas()
QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
QJsonObject object = doc.object();
- QString atlas = object.value(QLatin1String("image")).toString();
+ QString atlas = object.value("image"_L1).toString();
Q_ASSERT(!atlas.isEmpty());
- const int cursorsPerRow = object.value(QLatin1String("cursorsPerRow")).toDouble();
+ const int cursorsPerRow = object.value("cursorsPerRow"_L1).toDouble();
Q_ASSERT(cursorsPerRow);
m_cursorAtlas.cursorsPerRow = cursorsPerRow;
- const QJsonArray hotSpots = object.value(QLatin1String("hotSpots")).toArray();
+ const QJsonArray hotSpots = object.value("hotSpots"_L1).toArray();
Q_ASSERT(hotSpots.count() == Qt::LastCursor + 1);
for (int i = 0; i < hotSpots.count(); i++) {
QPoint hotSpot(hotSpots[i].toArray()[0].toDouble(), hotSpots[i].toArray()[1].toDouble());
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index 09c102b66f..faca562bce 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -69,10 +69,12 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
Q_LOGGING_CATEGORY(qLcEglDevDebug, "qt.qpa.egldeviceintegration")
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String("/egldeviceintegrations"), Qt::CaseInsensitive))
+ (QEglFSDeviceIntegrationFactoryInterface_iid, "/egldeviceintegrations"_L1, Qt::CaseInsensitive))
QStringList QEglFSDeviceIntegrationFactory::keys()
{
@@ -114,7 +116,7 @@ int QEglFSDeviceIntegration::framebufferIndex() const
{
int fbIndex = 0;
#if QT_CONFIG(regularexpression)
- QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
+ QRegularExpression fbIndexRx("fb(\\d+)"_L1);
QFileInfo fbinfo(QString::fromLocal8Bit(fbDeviceName()));
QRegularExpressionMatch match;
if (fbinfo.isSymLink())
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 33b57353fc..0dd80b0473 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -103,6 +103,8 @@ static void initResources()
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
QEglFSIntegration::QEglFSIntegration()
: m_kbdMgr(nullptr),
m_display(EGL_NO_DISPLAY),
@@ -442,7 +444,7 @@ void QEglFSIntegration::createInputHandlers()
{
#if QT_CONFIG(libinput)
if (!qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT")) {
- new QLibInputHandler(QLatin1String("libinput"), QString());
+ new QLibInputHandler("libinput"_L1, QString());
return;
}
#endif
@@ -450,16 +452,16 @@ void QEglFSIntegration::createInputHandlers()
#if QT_CONFIG(tslib)
bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB");
if (useTslib)
- new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */);
+ new QTsLibMouseHandler("TsLib"_L1, QString() /* spec */);
#endif
#if QT_CONFIG(evdev)
- m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
- new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
+ m_kbdMgr = new QEvdevKeyboardManager("EvdevKeyboard"_L1, QString() /* spec */, this);
+ new QEvdevMouseManager("EvdevMouse"_L1, QString() /* spec */, this);
#if QT_CONFIG(tslib)
if (!useTslib)
#endif
- new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
+ new QEvdevTouchManager("EvdevTouch"_L1, QString() /* spec */, this);
#endif
#if QT_CONFIG(integrityhid)
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp
index 697d92a5ca..1ab354afe5 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp
@@ -41,6 +41,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
QEglFSEmulatorScreen::QEglFSEmulatorScreen(const QJsonObject &screenDescription)
: QEglFSScreen(eglGetDisplay(EGL_DEFAULT_DISPLAY))
, m_id(0)
@@ -112,60 +114,60 @@ void QEglFSEmulatorScreen::initFromJsonObject(const QJsonObject &description)
{
QJsonValue value;
- value = description.value(QLatin1String("id"));
+ value = description.value("id"_L1);
if (!value.isUndefined() && value.isDouble())
m_id = value.toInt();
- value = description.value(QLatin1String("description"));
+ value = description.value("description"_L1);
if (!value.isUndefined() && value.isString())
m_description = value.toString();
- value = description.value(QLatin1String("geometry"));
+ value = description.value("geometry"_L1);
if (!value.isUndefined() && value.isObject()) {
QJsonObject geometryObject = value.toObject();
- value = geometryObject.value(QLatin1String("x"));
+ value = geometryObject.value("x"_L1);
if (!value.isUndefined() && value.isDouble())
m_geometry.setX(value.toInt());
- value = geometryObject.value(QLatin1String("y"));
+ value = geometryObject.value("y"_L1);
if (!value.isUndefined() && value.isDouble())
m_geometry.setY(value.toInt());
- value = geometryObject.value(QLatin1String("width"));
+ value = geometryObject.value("width"_L1);
if (!value.isUndefined() && value.isDouble())
m_geometry.setWidth(value.toInt());
- value = geometryObject.value(QLatin1String("height"));
+ value = geometryObject.value("height"_L1);
if (!value.isUndefined() && value.isDouble())
m_geometry.setHeight(value.toInt());
}
- value = description.value(QLatin1String("depth"));
+ value = description.value("depth"_L1);
if (!value.isUndefined() && value.isDouble())
m_depth = value.toInt();
- value = description.value(QLatin1String("format"));
+ value = description.value("format"_L1);
if (!value.isUndefined() && value.isDouble())
m_format = static_cast<QImage::Format>(value.toInt());
- value = description.value(QLatin1String("physicalSize"));
+ value = description.value("physicalSize"_L1);
if (!value.isUndefined() && value.isObject()) {
QJsonObject physicalSizeObject = value.toObject();
- value = physicalSizeObject.value(QLatin1String("width"));
+ value = physicalSizeObject.value("width"_L1);
if (!value.isUndefined() && value.isDouble())
m_physicalSize.setWidth(value.toInt());
- value = physicalSizeObject.value(QLatin1String("height"));
+ value = physicalSizeObject.value("height"_L1);
if (!value.isUndefined() && value.isDouble())
m_physicalSize.setHeight(value.toInt());
}
- value = description.value(QLatin1String("refreshRate"));
+ value = description.value("refreshRate"_L1);
if (!value.isUndefined() && value.isDouble())
m_refreshRate = value.toDouble();
- value = description.value(QLatin1String("nativeOrientation"));
+ value = description.value("nativeOrientation"_L1);
if (!value.isUndefined() && value.isDouble())
m_nativeOrientation = static_cast<Qt::ScreenOrientation>(value.toInt());
- value = description.value(QLatin1String("orientation"));
+ value = description.value("orientation"_L1);
if (!value.isUndefined() && value.isDouble())
m_orientation = static_cast<Qt::ScreenOrientation>(value.toInt());
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
index 52db076b74..1aac34dd43 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
@@ -64,6 +64,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
@@ -289,14 +291,14 @@ void QEglFSKmsGbmCursor::initCursorAtlas()
QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
QJsonObject object = doc.object();
- QString atlas = object.value(QLatin1String("image")).toString();
+ QString atlas = object.value("image"_L1).toString();
Q_ASSERT(!atlas.isEmpty());
- const int cursorsPerRow = object.value(QLatin1String("cursorsPerRow")).toDouble();
+ const int cursorsPerRow = object.value("cursorsPerRow"_L1).toDouble();
Q_ASSERT(cursorsPerRow);
m_cursorAtlas.cursorsPerRow = cursorsPerRow;
- const QJsonArray hotSpots = object.value(QLatin1String("hotSpots")).toArray();
+ const QJsonArray hotSpots = object.value("hotSpots"_L1).toArray();
Q_ASSERT(hotSpots.count() == Qt::LastCursor + 1);
for (int i = 0; i < hotSpots.count(); i++) {
QPoint hotSpot(hotSpots[i].toArray()[0].toDouble(), hotSpots[i].toArray()[1].toDouble());
diff --git a/src/plugins/platforms/eglfs/qeglfsmain.cpp b/src/plugins/platforms/eglfs/qeglfsmain.cpp
index aefa1e23f8..5a6cb286df 100644
--- a/src/plugins/platforms/eglfs/qeglfsmain.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsmain.cpp
@@ -42,6 +42,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
class QEglFSIntegrationPlugin : public QPlatformIntegrationPlugin
{
Q_OBJECT
@@ -53,7 +55,7 @@ public:
QPlatformIntegration* QEglFSIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
- if (!system.compare(QLatin1String("eglfs"), Qt::CaseInsensitive))
+ if (!system.compare("eglfs"_L1, Qt::CaseInsensitive))
return new QEglFSIntegration;
return nullptr;