mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Unbreak c2.ChannelType
This commit is contained in:
parent
ef2ae52bed
commit
121317cbd4
|
@ -165,30 +165,3 @@ private:
|
|||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
template <>
|
||||
constexpr magic_enum::customize::customize_t
|
||||
magic_enum::customize::enum_name<chatterino::Channel::Type>(
|
||||
chatterino::Channel::Type value) noexcept
|
||||
{
|
||||
using Type = chatterino::Channel::Type;
|
||||
switch (value)
|
||||
{
|
||||
case Type::Twitch:
|
||||
return "twitch";
|
||||
case Type::TwitchWhispers:
|
||||
return "whispers";
|
||||
case Type::TwitchWatching:
|
||||
return "watching";
|
||||
case Type::TwitchMentions:
|
||||
return "mentions";
|
||||
case Type::TwitchLive:
|
||||
return "live";
|
||||
case Type::TwitchAutomod:
|
||||
return "automod";
|
||||
case Type::Misc:
|
||||
return "misc";
|
||||
default:
|
||||
return default_tag;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -805,6 +805,32 @@ void SplitContainer::popup()
|
|||
window.show();
|
||||
}
|
||||
|
||||
QString channelTypeToString(Channel::Type value) noexcept
|
||||
{
|
||||
using Type = chatterino::Channel::Type;
|
||||
switch (value)
|
||||
{
|
||||
default:
|
||||
assert(false && "value cannot be serialized");
|
||||
return "never";
|
||||
|
||||
case Type::Twitch:
|
||||
return "twitch";
|
||||
case Type::TwitchWhispers:
|
||||
return "whispers";
|
||||
case Type::TwitchWatching:
|
||||
return "watching";
|
||||
case Type::TwitchMentions:
|
||||
return "mentions";
|
||||
case Type::TwitchLive:
|
||||
return "live";
|
||||
case Type::TwitchAutomod:
|
||||
return "automod";
|
||||
case Type::Misc:
|
||||
return "misc";
|
||||
}
|
||||
}
|
||||
|
||||
NodeDescriptor SplitContainer::buildDescriptorRecursively(
|
||||
const Node *currentNode) const
|
||||
{
|
||||
|
@ -814,7 +840,7 @@ NodeDescriptor SplitContainer::buildDescriptorRecursively(
|
|||
currentNode->split_->getIndirectChannel().getType();
|
||||
|
||||
SplitNodeDescriptor result;
|
||||
result.type_ = qmagicenum::enumNameString(channelType);
|
||||
result.type_ = channelTypeToString(channelType);
|
||||
result.channelName_ = currentNode->split_->getChannel()->getName();
|
||||
result.filters_ = currentNode->split_->getFilters();
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue