diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divelocationmodel.cpp | 2 | ||||
-rw-r--r-- | qt-models/messagehandlermodel.cpp | 11 |
2 files changed, 3 insertions, 10 deletions
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index 5fca153a4..26cf3353e 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -229,7 +229,7 @@ QStringList DiveSiteSortedModel::allSiteNames() const // (more precisely: the core has more sites than the model is aware of), // we might get an invalid index. if (idx < 0 || idx > dive_site_table.nr) { - fprintf(stderr, "DiveSiteSortedModel::allSiteNames(): invalid index"); + SSRF_INFO("DiveSiteSortedModel::allSiteNames(): invalid index"); continue; } locationNames << QString(dive_site_table.dive_sites[idx]->name); diff --git a/qt-models/messagehandlermodel.cpp b/qt-models/messagehandlermodel.cpp index 4952758d2..f0807cf80 100644 --- a/qt-models/messagehandlermodel.cpp +++ b/qt-models/messagehandlermodel.cpp @@ -1,13 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "messagehandlermodel.h" - -/* based on logging bits from libdivecomputer */ -#if !defined(Q_OS_ANDROID) -#define INFO(fmt, ...) fprintf(stderr, "INFO: " fmt "\n", ##__VA_ARGS__) -#else -#include <android/log.h> -#define INFO(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, "Subsurface", "INFO: " fmt "\n", ##__VA_ARGS__); -#endif +#include "core/qthelper.h" #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) extern void writeToAppLogFile(QString logText); @@ -49,7 +42,7 @@ void MessageHandlerModel::addLog(QtMsgType type, const QString& message) beginInsertRows(QModelIndex(), rowCount(), rowCount()); m_data.append({message, type}); endInsertRows(); - INFO("%s", qPrintable(message)); + SSRF_INFO("%s", qPrintable(message)); #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) writeToAppLogFile(message); #endif |