refactor: adapt magic_enum to Qt (#5258)

This commit is contained in:
nerix
2024-03-23 12:22:42 +01:00
committed by GitHub
parent 044d457d20
commit ed20e71db4
25 changed files with 603 additions and 80 deletions
+2 -3
View File
@@ -5,6 +5,7 @@
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "util/CancellationToken.hpp"
#include "util/QMagicEnum.hpp"
#include <magic_enum/magic_enum.hpp>
#include <QJsonDocument>
@@ -1172,9 +1173,7 @@ void Helix::sendChatAnnouncement(
QJsonObject body;
body.insert("message", message);
const auto colorStr =
std::string{magic_enum::enum_name<HelixAnnouncementColor>(color)};
body.insert("color", QString::fromStdString(colorStr).toLower());
body.insert("color", qmagicenum::enumNameString(color).toLower());
this->makePost("chat/announcements", urlQuery)
.json(body)