diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-02-06 08:37:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-07 07:49:56 +0100 |
commit | bde1e6718385c4c7c92bfda9ee4b52b99ff92214 (patch) | |
tree | ca95a8e08d08b784b6beaa6159f8d3d3e3ccc041 | |
parent | 1298960aaa18217df44458312a8580a4d97b76e2 (diff) |
Android: Fix crash when using images in QML
Because qtdeclarative was merged back from stable and qtbase is
still lagging behind, they have become unsynchronized, causing
crashes when trying to get the device name from the platform
plugin and failing. To work around this until the merge goes
through, I've added a simple guard.
Task-number: QTBUG-36658
Change-Id: Ibc399ed325a1fbdeccad85ed8d4841edb7b2ba5d
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 7 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index d080c59198..e6a2096c80 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -148,9 +148,10 @@ Atlas::Atlas(const QSize &size) #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) QString *deviceName = static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName")); - static bool wrongfullyReportsBgra8888Support = deviceName->compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 - || deviceName->compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 - || deviceName->compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0; + static bool wrongfullyReportsBgra8888Support = deviceName != 0 + && (deviceName->compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0); #else static bool wrongfullyReportsBgra8888Support = false; #endif diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index ae1bec3f42..b738896a6c 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -684,9 +684,10 @@ void QSGPlainTexture::bind() #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) QString *deviceName = static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName")); - static bool wrongfullyReportsBgra8888Support = deviceName->compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 - || deviceName->compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 - || deviceName->compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0; + static bool wrongfullyReportsBgra8888Support = deviceName != 0 + && (deviceName->compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0); #else static bool wrongfullyReportsBgra8888Support = false; #endif |