From 8e106b0449f020dac6dc4cb005d41c825722c811 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 24 Mar 2024 21:15:36 +0100 Subject: [PATCH] core: replace qDebug() by report_info() in subsurface-helper.cpp Start unifying debug output. Signed-off-by: Berthold Stoeger --- subsurface-helper.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index 4c7e4c5c5..b881cab37 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -87,11 +87,11 @@ void run_mobile_ui(double initial_font_size) newDefaultFont.setFamily(family); newDefaultFont.setPointSize(basePointSize); (static_cast(QCoreApplication::instance()))->setFont(newDefaultFont); - qDebug() << "Detected OnePlus device, trying to force bundled font" << family; + report_info("Detected OnePlus device, trying to force bundled font %s", qPrintable(family)); QFont defaultFont = (static_cast(QCoreApplication::instance()))->font(); - qDebug() << "Qt reports default font is set as" << defaultFont.family(); + report_info("Qt reports default font is set as", qPrintable(defaultFont.family())); } else { - qDebug() << "Detected OnePlus device, but can't determine font family used"; + report_info("Detected OnePlus device, but can't determine font family used"); } } #endif @@ -144,7 +144,7 @@ void run_mobile_ui(double initial_font_size) #else engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); #endif - qDebug() << "loaded main.qml"; + report_info("loaded main.qml"); qqWindowObject = engine.rootObjects().value(0); if (!qqWindowObject) { report_info("can't create window object"); @@ -152,18 +152,18 @@ void run_mobile_ui(double initial_font_size) } QQuickWindow *qml_window = qobject_cast(qqWindowObject); qml_window->setIcon(QIcon(":subsurface-mobile-icon")); - qDebug() << "qqwindow devicePixelRatio" << qml_window->devicePixelRatio() << qml_window->screen()->devicePixelRatio(); + report_info("qqwindow devicePixelRatio %f %f", qml_window->devicePixelRatio(), qml_window->screen()->devicePixelRatio()); QScreen *screen = qml_window->screen(); int qmlWW = qml_window->width(); int qmlSW = screen->size().width(); - qDebug() << "qml_window reports width as" << qmlWW << "associated screen width" << qmlSW << "Qt screen reports width as" << availableScreenWidth; + report_info("qml_window reports width as %d associated screen width %d Qt screen reports width as %d", qmlWW, qmlSW, availableScreenWidth); QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged); QMLManager *manager = QMLManager::instance(); manager->setDevicePixelRatio(qml_window->devicePixelRatio(), qml_window->screen()); manager->qmlWindow = qqWindowObject; manager->screenChanged(screen); - qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch(); + report_info("qqwindow screen has ldpi/pdpi %f %f", screen->logicalDotsPerInch(), screen->physicalDotsPerInch()); #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) int width = 800; int height = 1200; @@ -172,7 +172,7 @@ void run_mobile_ui(double initial_font_size) int width_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_WIDTH", &ok); if (ok) { width = width_override; - qDebug() << "overriding window width:" << width; + report_info("overriding window width: %d", width); } } if (qEnvironmentVariableIsSet("SUBSURFACE_MOBILE_HEIGHT")) { @@ -180,7 +180,7 @@ void run_mobile_ui(double initial_font_size) int height_override = qEnvironmentVariableIntValue("SUBSURFACE_MOBILE_HEIGHT", &ok); if (ok) { height = height_override; - qDebug() << "overriding window height:" << height; + report_info("overriding window height: %d", height); } } qml_window->setHeight(height);