Commit 5aebd1a8 authored by David Edmundson's avatar David Edmundson Committed by Aleix Pol Gonzalez
Browse files

Fitler out annoying QML warnings

Qt 5.15 introduces a new syntax for connections.

Framework code can't port away due to having to support Qt5.12 which
does not include the new syntax.

This filters out the category.

We should remove this once we depend on Qt5.15 in frameworks.

BUG: 424259
parent 949aaf7b
......@@ -27,6 +27,7 @@
#include <QDBusConnection>
#include <QDBusMessage>
#include <QtQml/QQmlDebuggingEnabler>
#include <QLoggingCategory>
#include <KAboutData>
#include <KQuickAddons/QtQuickSettings>
......@@ -47,6 +48,21 @@
#include <QDir>
#include <QDBusConnectionInterface>
static QLoggingCategory::CategoryFilter oldCategoryFilter;
// Qt 5.15 introduces a new syntax for connections
// framework code can't port away due to needing Qt5.12
// this filters out the warnings
// Remove this once we depend on Qt5.15 in frameworks
void filterConnectionSyntaxWarning(QLoggingCategory *category)
{
if (qstrcmp(category->categoryName(), "qt.qml.connections") == 0) {
category->setEnabled(QtWarningMsg, false);
} else if (oldCategoryFilter) {
oldCategoryFilter(category);
}
}
int main(int argc, char *argv[])
{
if (qEnvironmentVariableIsSet("PLASMA_ENABLE_QML_DEBUG")) {
......@@ -70,6 +86,8 @@ int main(int argc, char *argv[])
QQuickWindow::setDefaultAlphaBuffer(true);
oldCategoryFilter = QLoggingCategory::installFilter(filterConnectionSyntaxWarning);
const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM");
KWorkSpace::detectPlatform(argc, argv);
QApplication app(argc, argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment