Skip to content

Commit

Permalink
Out out of range formatting for QJsonObject
Browse files Browse the repository at this point in the history
It doesn't work for Qt's map types and in fmt 11.1 it causes compilation errors.
  • Loading branch information
equeim committed Jan 8, 2025
1 parent de8302b commit 22e0a9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/log/formatters.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ namespace fmt {
struct formatter<Class> : tremotesf::impl::QDebugFormatter<Class> {}; \
}

#define DISABLE_RANGE_FORMATTING(Class) \
namespace fmt { \
template<> \
struct is_range<Class, char> : std::false_type {}; \
template<> \
struct is_range<const Class, char> : std::false_type {}; \
}

namespace fmt {
template<>
struct formatter<std::exception> : tremotesf::SimpleFormatter {
Expand Down
1 change: 1 addition & 0 deletions src/rpc/requestrouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "pragmamacros.h"
#include "rpc.h"

DISABLE_RANGE_FORMATTING(QJsonObject)
SPECIALIZE_FORMATTER_FOR_QDEBUG(QJsonObject)
SPECIALIZE_FORMATTER_FOR_QDEBUG(QNetworkProxy)
SPECIALIZE_FORMATTER_FOR_QDEBUG(QSslError)
Expand Down

0 comments on commit 22e0a9a

Please sign in to comment.