mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
move QString-formatting to helpers.hpp so fS works with it all the time
This commit is contained in:
parent
86a9f194f9
commit
795deac727
2 changed files with 12 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "util/helpers.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTime>
|
||||
|
@ -20,18 +20,8 @@ static void _log(const std::string &message)
|
|||
template <typename... Args>
|
||||
inline void Log(const std::string &formatString, Args &&... args)
|
||||
{
|
||||
detail::_log(fmt::format(formatString, std::forward<Args>(args)...));
|
||||
detail::_log(fS(formatString, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
} // namespace debug
|
||||
} // namespace chatterino
|
||||
|
||||
namespace fmt {
|
||||
|
||||
// format_arg for QString
|
||||
inline void format_arg(BasicFormatter<char> &f, const char *&, const QString &v)
|
||||
{
|
||||
f.writer().write("\"{}\"", v.toStdString());
|
||||
}
|
||||
|
||||
} // namespace fmt
|
||||
|
|
|
@ -11,3 +11,13 @@ auto fS(Args &&... args) -> decltype(fmt::format(std::forward<Args>(args)...))
|
|||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
namespace fmt {
|
||||
|
||||
// format_arg for QString
|
||||
inline void format_arg(BasicFormatter<char> &f, const char *&, const QString &v)
|
||||
{
|
||||
f.writer().write("\"{}\"", v.toStdString());
|
||||
}
|
||||
|
||||
} // namespace fmt
|
||||
|
|
Loading…
Reference in a new issue