Prevent QOpenGLShaderProgram::link() from showing unnecessary warnings.

If the liking didn't fail there's no need to print out warnings. The
warnings can still be accessed by the application after calling link()
through the log() function.

This prevents warnings such as these from appearing:

QOpenGLShader:🔗 "No errors."

Task-number: QTBUG-31326
Change-Id: I03c9be5dfada8822c3ab1c3610eac2fc0a91410b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Samuel Rødal 2013-05-24 09:19:12 +02:00 committed by The Qt Project
parent 6359f42064
commit 9ae5162b3c
2 changed files with 13 additions and 9 deletions

View File

@ -907,11 +907,13 @@ bool QOpenGLShaderProgram::link()
GLint len;
d->glfuncs->glGetProgramInfoLog(program, value, &len, logbuf);
d->log = QString::fromLatin1(logbuf);
QString name = objectName();
if (name.isEmpty())
qWarning() << "QOpenGLShader::link:" << d->log;
else
qWarning() << "QOpenGLShader::link[" << name << "]:" << d->log;
if (!d->linked) {
QString name = objectName();
if (name.isEmpty())
qWarning() << "QOpenGLShader::link:" << d->log;
else
qWarning() << "QOpenGLShader::link[" << name << "]:" << d->log;
}
delete [] logbuf;
}
return d->linked;

View File

@ -957,10 +957,12 @@ bool QGLShaderProgram::link()
d->glfuncs->glGetProgramInfoLog(program, value, &len, logbuf);
d->log = QString::fromLatin1(logbuf);
QString name = objectName();
if (name.isEmpty())
qWarning() << "QGLShader::link:" << d->log;
else
qWarning() << "QGLShader::link[" << name << "]:" << d->log;
if (!d->linked) {
if (name.isEmpty())
qWarning() << "QGLShader::link:" << d->log;
else
qWarning() << "QGLShader::link[" << name << "]:" << d->log;
}
delete [] logbuf;
}
return d->linked;