summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-10-30 23:03:59 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-10-30 22:09:52 +0100
commit945a0a87482dc24c5f12cdaaf1b3576549a4c8a5 (patch)
tree3deb03bdb38fc8a29b5deeb96547178f89e977e1
parent68c2b10161fb8bfb7572a058586b33f652aea47c (diff)
downloadsubsurface-945a0a87482dc24c5f12cdaaf1b3576549a4c8a5.tar.gz
desktop-main.cpp: don't validate for custom backends
Without this patch the user can pass a custom backend like 'software' and the validation will still be performed. In a case where the validation fails Subsurface will still exit. With this patch the validation is performed *only* for the standard backend which is OpenGL (or an empty QT_QUICK_BACKEND) env. variable. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r--subsurface-desktop-main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index d0b764e7b..e8f57ecff 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -140,6 +140,18 @@ bool haveFilesOnCommandLine()
void validateGL()
{
+ QString quickBackend = qgetenv("QT_QUICK_BACKEND");
+ /* an empty QT_QUICK_BACKEND env. variable means OpenGL (default).
+ * only validate OpenGL; for everything else print out and return.
+ * https://doc.qt.io/qt-5/qtquick-visualcanvas-adaptations.html
+ */
+ if (!quickBackend.isEmpty()) {
+ if (verbose) {
+ qDebug() << QStringLiteral(VALIDATE_GL_PREFIX "'QT_QUICK_BACKEND' is set to '%1'. "
+ "Skipping validation.").arg(quickBackend).toUtf8().data();
+ }
+ return;
+ }
GLint verMajor, verMinor;
const char *glError = NULL;
QOpenGLContext ctx;