diff options
Diffstat (limited to 'src/plugins/platforms/linuxfb')
-rw-r--r-- | src/plugins/platforms/linuxfb/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/main.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 10 |
5 files changed, 15 insertions, 21 deletions
diff --git a/src/plugins/platforms/linuxfb/CMakeLists.txt b/src/plugins/platforms/linuxfb/CMakeLists.txt index a671dcfc1e..ba18cea50c 100644 --- a/src/plugins/platforms/linuxfb/CMakeLists.txt +++ b/src/plugins/platforms/linuxfb/CMakeLists.txt @@ -1,4 +1,5 @@ -# Generated from linuxfb.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## QLinuxFbIntegrationPlugin Plugin: @@ -7,7 +8,7 @@ qt_internal_add_plugin(QLinuxFbIntegrationPlugin OUTPUT_NAME qlinuxfb PLUGIN_TYPE platforms - DEFAULT_IF ${QT_QPA_DEFAULT_PLATFORM} MATCHES linuxfb # special case + DEFAULT_IF "linuxfb" IN_LIST QT_QPA_PLATFORMS SOURCES main.cpp qlinuxfbintegration.cpp qlinuxfbintegration.h @@ -22,9 +23,6 @@ qt_internal_add_plugin(QLinuxFbIntegrationPlugin Qt::GuiPrivate ) -#### Keys ignored in scope 1:.:.:linuxfb.pro:<TRUE>: -# OTHER_FILES = "linuxfb.json" - ## Scopes: ##################################################################### @@ -39,6 +37,3 @@ qt_internal_extend_target(QLinuxFbIntegrationPlugin CONDITION TARGET Qt::KmsSupp LIBRARIES Qt::KmsSupportPrivate ) - -#### Keys ignored in scope 4:.:.:linuxfb.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: -# PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/linuxfb/main.cpp b/src/plugins/platforms/linuxfb/main.cpp index 9d05e64466..12aaafc21a 100644 --- a/src/plugins/platforms/linuxfb/main.cpp +++ b/src/plugins/platforms/linuxfb/main.cpp @@ -22,7 +22,7 @@ QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, c if (!system.compare("linuxfb"_L1, Qt::CaseInsensitive)) return new QLinuxFbIntegration(paramList); - return 0; + return nullptr; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp index beb8349635..56b28ba48c 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp @@ -62,7 +62,7 @@ public: void swapBuffers(Output *output); - int outputCount() const { return m_outputs.count(); } + int outputCount() const { return m_outputs.size(); } Output *output(int idx) { return &m_outputs[idx]; } private: @@ -125,8 +125,7 @@ void QLinuxFbDevice::close() void *QLinuxFbDevice::nativeDisplay() const { - Q_UNREACHABLE(); - return nullptr; + Q_UNREACHABLE_RETURN(nullptr); } QPlatformScreen *QLinuxFbDevice::createScreen(const QKmsOutput &output) @@ -243,7 +242,7 @@ bool QLinuxFbDevice::createFramebuffer(QLinuxFbDevice::Output *output, int buffe qErrnoWarning(errno, "Failed to map dumb buffer"); return false; } - fb.p = mmap(0, fb.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd(), mreq.offset); + fb.p = mmap(nullptr, fb.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd(), mreq.offset); if (fb.p == MAP_FAILED) { qErrnoWarning(errno, "Failed to mmap dumb buffer"); return false; @@ -408,7 +407,7 @@ QRegion QLinuxFbDrmScreen::doRedraw() // Image has alpha but no need for blending at this stage. // Do not waste time with the default SourceOver. pntr.setCompositionMode(QPainter::CompositionMode_Source); - for (const QRect &rect : qAsConst(output->dirty[output->backFb])) + for (const QRect &rect : std::as_const(output->dirty[output->backFb])) pntr.drawImage(rect, mScreenImage, rect); pntr.end(); diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp index a9ab8463f4..f87766cf1b 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp @@ -42,7 +42,7 @@ QLinuxFbIntegration::QLinuxFbIntegration(const QStringList ¶mList) : m_primaryScreen(nullptr), m_fontDb(new QGenericUnixFontDatabase), m_services(new QGenericUnixServices), - m_kbdMgr(0) + m_kbdMgr(nullptr) { #if QT_CONFIG(kms) if (qEnvironmentVariableIntValue("QT_QPA_FB_DRM") != 0) @@ -147,7 +147,7 @@ QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const QFunctionPointer QLinuxFbIntegration::platformFunction(const QByteArray &function) const { Q_UNUSED(function); - return 0; + return nullptr; } #if QT_CONFIG(evdev) diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index 1fedb546eb..e2826f3946 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -213,7 +213,7 @@ static QImage::Format determineFormat(const fb_var_screeninfo &info, int depth) static int openTtyDevice(const QString &device) { - const char *const devs[] = { "/dev/tty0", "/dev/tty", "/dev/console", 0 }; + const char *const devs[] = { "/dev/tty0", "/dev/tty", "/dev/console", nullptr }; int fd = -1; if (device.isEmpty()) { @@ -253,9 +253,9 @@ static void blankScreen(int fd, bool on) } QLinuxFbScreen::QLinuxFbScreen(const QStringList &args) - : mArgs(args), mFbFd(-1), mTtyFd(-1), mBlitter(0) + : mArgs(args), mFbFd(-1), mTtyFd(-1), mBlitter(nullptr) { - mMmap.data = 0; + mMmap.data = nullptr; } QLinuxFbScreen::~QLinuxFbScreen() @@ -286,7 +286,7 @@ bool QLinuxFbScreen::initialize() bool doSwitchToGraphicsMode = true; // Parse arguments - for (const QString &arg : qAsConst(mArgs)) { + for (const QString &arg : std::as_const(mArgs)) { QRegularExpressionMatch match; if (arg == "nographicsmodeswitch"_L1) doSwitchToGraphicsMode = false; @@ -344,7 +344,7 @@ bool QLinuxFbScreen::initialize() // mmap the framebuffer mMmap.size = finfo.smem_len; - uchar *data = (unsigned char *)mmap(0, mMmap.size, PROT_READ | PROT_WRITE, MAP_SHARED, mFbFd, 0); + uchar *data = (unsigned char *)mmap(nullptr, mMmap.size, PROT_READ | PROT_WRITE, MAP_SHARED, mFbFd, 0); if ((long)data == -1) { qErrnoWarning(errno, "Failed to mmap framebuffer"); return false; |