Disable QML console.debug() with QT_NO_DEBUG_OUTPUT

This commit is contained in:
Matti Viljanen 2020-03-21 13:24:40 +02:00
parent 366cafde42
commit 64cc9951db
No known key found for this signature in database
GPG key ID: CF32A1495158F888
2 changed files with 9 additions and 1 deletions

View file

@ -14,7 +14,7 @@ TARGET = harbour-batterybuddy
CONFIG += sailfishapp sailfishapp_i18n
#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += QT_NO_DEBUG_OUTPUT
HEADERS += \
src/battery.h \

View file

@ -27,6 +27,9 @@
#include <QQmlEngine>
#include <QTimer>
#include <QDebug>
#ifdef QT_NO_DEBUG_OUTPUT
#include <QLoggingCategory>
#endif
#include "battery.h"
#include "settings.h"
@ -43,6 +46,11 @@ int main(int argc, char *argv[])
//
// To display the view, call "show()" (will show fullscreen on device).
#ifdef QT_NO_DEBUG_OUTPUT
// Disable QML debug level logging
QLoggingCategory::setFilterRules("*.debug=false");
#endif
qInfo() << "Starting Battery Buddy...";
QGuiApplication* app = SailfishApp::application(argc, argv);