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>
This commit is contained in:
Lubomir I. Ivanov 2017-10-30 23:03:59 +02:00
parent 68c2b10161
commit 945a0a8748

View file

@ -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;