From 6a7d2da7dde2500616022cdb9ea9867513d17053 Mon Sep 17 00:00:00 2001 From: Xing LinKun Date: Tue, 30 Mar 2021 17:59:02 +0800 Subject: [PATCH] Fix coding style in android platform and style plugins Change-Id: Ic0a1150178c571ea0c20a045ad7520d23d6d878c Reviewed-by: Volker Hilsheimer --- .../platforms/android/androidcontentfileengine.cpp | 3 +-- .../platforms/android/qandroidplatformintegration.cpp | 8 ++++---- .../platforms/android/qandroidplatformopenglwindow.cpp | 4 ++-- src/plugins/styles/android/qandroidstyle.cpp | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/platforms/android/androidcontentfileengine.cpp b/src/plugins/platforms/android/androidcontentfileengine.cpp index 9cea454c16..8ac950dbfe 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -76,9 +76,8 @@ bool AndroidContentFileEngine::open(QIODevice::OpenMode openMode) QJniObject::fromString(fileName(DefaultName)).object(), QJniObject::fromString(openModeStr).object()); - if (fd < 0) { + if (fd < 0) return false; - } return QFSFileEngine::open(openMode, fd, QFile::AutoCloseHandle); } diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 5f90a05648..bb25329ec1 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -109,14 +109,14 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA if (resource == "AndroidStandardPalette") { if (m_androidStyle) return &m_androidStyle->m_standardPalette; - else - return nullptr; + + return nullptr; } if (resource == "AndroidQWidgetFonts") { if (m_androidStyle) return &m_androidStyle->m_QWidgetsFonts; - else - return nullptr; + + return nullptr; } if (resource == "AndroidDeviceName") { static QString deviceName = QtAndroid::deviceName(); diff --git a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp index f69e9e389f..2fb93f055f 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp +++ b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp @@ -191,8 +191,8 @@ QSurfaceFormat QAndroidPlatformOpenGLWindow::format() const { if (m_nativeWindow == 0) return window()->requestedFormat(); - else - return m_format; + + return m_format; } void QAndroidPlatformOpenGLWindow::clearEgl() diff --git a/src/plugins/styles/android/qandroidstyle.cpp b/src/plugins/styles/android/qandroidstyle.cpp index 63c5767126..1d9ce7e9b0 100644 --- a/src/plugins/styles/android/qandroidstyle.cpp +++ b/src/plugins/styles/android/qandroidstyle.cpp @@ -1352,9 +1352,10 @@ void QAndroidStyle::AndroidLayerDrawable::draw(QPainter *painter, const QStyleOp QAndroidStyle::AndroidDrawable *QAndroidStyle::AndroidLayerDrawable::layer(int id) const { - for (const LayerType &layer : m_layers) + for (const LayerType &layer : m_layers) { if (layer.first == id) return layer.second; + } return 0; }