diff --git a/core/errorhelper.h b/core/errorhelper.h index 4a32754ee..179afdd23 100644 --- a/core/errorhelper.h +++ b/core/errorhelper.h @@ -10,7 +10,10 @@ extern "C" { extern int verbose; extern int report_error(const char *fmt, ...); +extern void report_info(const char *fmt, ...); extern void set_error_cb(void(*cb)(char *)); // Callback takes ownership of passed string +#define SSRF_INFO(fmt, ...) report_info(fmt, ##__VA_ARGS__) + #ifdef __cplusplus } diff --git a/core/profile.c b/core/profile.c index 1df947804..09a387d7e 100644 --- a/core/profile.c +++ b/core/profile.c @@ -19,6 +19,7 @@ #include "profile.h" #include "gaspressures.h" #include "deco.h" +#include "errorhelper.h" #include "libdivecomputer/parser.h" #include "libdivecomputer/version.h" #include "membuffer.h" diff --git a/core/qthelper.h b/core/qthelper.h index e781b6a1a..a32bc8ebb 100644 --- a/core/qthelper.h +++ b/core/qthelper.h @@ -147,14 +147,8 @@ volume_t string_to_volume(const char *str, pressure_t workp); fraction_t string_to_fraction(const char *str); void emit_reset_signal(); -extern void report_info(const char *fmt, ...); - #ifdef __cplusplus } #endif -// 4) SSRF_INFO macro to replace fprintf calls in our code -// (originally based on logging bits from libdivecomputer) -#define SSRF_INFO(fmt, ...) report_info(fmt, ##__VA_ARGS__) - #endif // QTHELPER_H diff --git a/core/trip.c b/core/trip.c index d57937360..c75093db9 100644 --- a/core/trip.c +++ b/core/trip.c @@ -7,7 +7,7 @@ #include "subsurface-string.h" #include "selection.h" #include "table.h" -#include "core/qthelper.h" +#include "core/errorhelper.h" #ifdef DEBUG_TRIP void dump_trip_list(void) diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index d382d6f94..826e8f5df 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -2,7 +2,7 @@ #include "core/units.h" #include "qt-models/divelocationmodel.h" #include "core/subsurface-qt/divelistnotifier.h" -#include "core/qthelper.h" +#include "core/errorhelper.h" #include "core/divesite.h" #include "core/divelog.h" #include "core/metrics.h" diff --git a/qt-models/messagehandlermodel.cpp b/qt-models/messagehandlermodel.cpp index e22569d84..5c72d148b 100644 --- a/qt-models/messagehandlermodel.cpp +++ b/qt-models/messagehandlermodel.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "messagehandlermodel.h" -#include "core/qthelper.h" +#include "core/errorhelper.h" #include "QRegularExpression" #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) @@ -62,6 +62,7 @@ const QString MessageHandlerModel::logAsString() copyString += data.message + "\n"; return copyString; } + QVariant MessageHandlerModel::data(const QModelIndex& idx, int role) const { switch(role) {