diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-02-02 09:35:43 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-02-02 21:17:21 +0000 |
commit | d45fcac787196bcbbe366c997801d5bcebf1a475 (patch) | |
tree | d4802abe2af927f8af4d5594d9c7a074aafaa3c3 /src/svg/qsvgtinydocument.cpp | |
parent | 21d2f50f6d84be5dc006135ea726e9d34d47b0e4 (diff) | |
download | qtsvg-d45fcac787196bcbbe366c997801d5bcebf1a475.tar.gz |
Introduce logging category "qt.svg"
It is then possible to suppress warnings by
setting for example QT_LOGGING_RULES to qt.svg.warning=false.
This will suppress the warnings floods which are currently
produced by faulty theme svg icons on KDE 5 systems.
Task-number: QTBUG-52079
Change-Id: I50e3c2e3eab610e182293c8938c6188694eabfb7
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/svg/qsvgtinydocument.cpp')
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index 7bb1f75..15351bd 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -104,7 +104,7 @@ QByteArray qt_inflateGZipDataFrom(QIODevice *device) // Adding 16 to the window size gives us gzip decoding if (inflateInit2(&zlibStream, MAX_WBITS + 16) != Z_OK) { - qWarning("Cannot initialize zlib, because: %s", + qCWarning(lcSvgHandler, "Cannot initialize zlib, because: %s", (zlibStream.msg != NULL ? zlibStream.msg : "Unknown error")); return QByteArray(); } @@ -137,7 +137,7 @@ QByteArray qt_inflateGZipDataFrom(QIODevice *device) case Z_STREAM_ERROR: case Z_MEM_ERROR: { inflateEnd(&zlibStream); - qWarning("Error while inflating gzip file: %s", + qCWarning(lcSvgHandler, "Error while inflating gzip file: %s", (zlibStream.msg != NULL ? zlibStream.msg : "Unknown error")); destination.chop(zlibStream.avail_out); return destination; @@ -167,8 +167,8 @@ QSvgTinyDocument * QSvgTinyDocument::load(const QString &fileName) { QFile file(fileName); if (!file.open(QFile::ReadOnly)) { - qWarning("Cannot open file '%s', because: %s", - qPrintable(fileName), qPrintable(file.errorString())); + qCWarning(lcSvgHandler, "Cannot open file '%s', because: %s", + qPrintable(fileName), qPrintable(file.errorString())); return 0; } @@ -185,7 +185,7 @@ QSvgTinyDocument * QSvgTinyDocument::load(const QString &fileName) doc = handler.document(); doc->m_animationDuration = handler.animationDuration(); } else { - qWarning("Cannot read file '%s', because: %s (line %d)", + qCWarning(lcSvgHandler, "Cannot read file '%s', because: %s (line %d)", qPrintable(fileName), qPrintable(handler.errorString()), handler.lineNumber()); } return doc; @@ -261,7 +261,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id, QSvgNode *node = scopeNode(id); if (!node) { - qDebug("Couldn't find node %s. Skipping rendering.", qPrintable(id)); + qCDebug(lcSvgHandler, "Couldn't find node %s. Skipping rendering.", qPrintable(id)); return; } if (m_time.isNull()) { @@ -443,7 +443,7 @@ QMatrix QSvgTinyDocument::matrixForElement(const QString &id) const QSvgNode *node = scopeNode(id); if (!node) { - qDebug("Couldn't find node %s. Skipping rendering.", qPrintable(id)); + qCDebug(lcSvgHandler, "Couldn't find node %s. Skipping rendering.", qPrintable(id)); return QMatrix(); } |