summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2013-05-24 09:19:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-24 11:53:09 +0200
commit9ae5162b3c972a2cedba4f817235aaf96e7dfd7e (patch)
treed2e007e2fa71af4cccb365d6437fae40c497487e
parent6359f42064cdd9733ac54c3931156fd37448838e (diff)
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::link: "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>
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp12
-rw-r--r--src/opengl/qglshaderprogram.cpp10
2 files changed, 13 insertions, 9 deletions
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index 1cde0cb92d..8278e4fb5a 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -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;
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 4859df21d6..e7b7ad1348 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -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;