core: move report_info and SSRF_INFO to errorhelper.h

qthelper.h is an absolute monstrosity and it is unclear what
report_info and SSRF_INFO have to do with Qt.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-12 08:52:21 +01:00 committed by Dirk Hohndel
parent d653cec7a4
commit fcf0bda042
6 changed files with 8 additions and 9 deletions

View file

@ -10,7 +10,10 @@ extern "C" {
extern int verbose; extern int verbose;
extern int report_error(const char *fmt, ...); 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 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 #ifdef __cplusplus
} }

View file

@ -19,6 +19,7 @@
#include "profile.h" #include "profile.h"
#include "gaspressures.h" #include "gaspressures.h"
#include "deco.h" #include "deco.h"
#include "errorhelper.h"
#include "libdivecomputer/parser.h" #include "libdivecomputer/parser.h"
#include "libdivecomputer/version.h" #include "libdivecomputer/version.h"
#include "membuffer.h" #include "membuffer.h"

View file

@ -147,14 +147,8 @@ volume_t string_to_volume(const char *str, pressure_t workp);
fraction_t string_to_fraction(const char *str); fraction_t string_to_fraction(const char *str);
void emit_reset_signal(); void emit_reset_signal();
extern void report_info(const char *fmt, ...);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #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 #endif // QTHELPER_H

View file

@ -7,7 +7,7 @@
#include "subsurface-string.h" #include "subsurface-string.h"
#include "selection.h" #include "selection.h"
#include "table.h" #include "table.h"
#include "core/qthelper.h" #include "core/errorhelper.h"
#ifdef DEBUG_TRIP #ifdef DEBUG_TRIP
void dump_trip_list(void) void dump_trip_list(void)

View file

@ -2,7 +2,7 @@
#include "core/units.h" #include "core/units.h"
#include "qt-models/divelocationmodel.h" #include "qt-models/divelocationmodel.h"
#include "core/subsurface-qt/divelistnotifier.h" #include "core/subsurface-qt/divelistnotifier.h"
#include "core/qthelper.h" #include "core/errorhelper.h"
#include "core/divesite.h" #include "core/divesite.h"
#include "core/divelog.h" #include "core/divelog.h"
#include "core/metrics.h" #include "core/metrics.h"

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include "messagehandlermodel.h" #include "messagehandlermodel.h"
#include "core/qthelper.h" #include "core/errorhelper.h"
#include "QRegularExpression" #include "QRegularExpression"
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
@ -62,6 +62,7 @@ const QString MessageHandlerModel::logAsString()
copyString += data.message + "\n"; copyString += data.message + "\n";
return copyString; return copyString;
} }
QVariant MessageHandlerModel::data(const QModelIndex& idx, int role) const QVariant MessageHandlerModel::data(const QModelIndex& idx, int role) const
{ {
switch(role) { switch(role) {