diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 2dd350552..6c4ca3506 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -175,7 +175,7 @@ public: BoolSetting notificationToast = {"/notifications/enableToast", false}; IntSetting openFromToast = { "/notifications/openFromToast", - static_cast(ToastReactions::OpenInBrowser)}; + static_cast(ToastReaction::OpenInBrowser)}; /// External tools // Streamlink diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index d6d5f03c3..9dcbd6516 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -27,11 +27,11 @@ namespace chatterino { -std::map Toasts::reactionToString = { - {ToastReactions::OpenInBrowser, OPEN_IN_BROWSER}, - {ToastReactions::OpenInPlayer, OPEN_PLAYER_IN_BROWSER}, - {ToastReactions::OpenInStreamlink, OPEN_IN_STREAMLINK}, - {ToastReactions::DontOpen, DONT_OPEN}}; +std::map Toasts::reactionToString = { + {ToastReaction::OpenInBrowser, OPEN_IN_BROWSER}, + {ToastReaction::OpenInPlayer, OPEN_PLAYER_IN_BROWSER}, + {ToastReaction::OpenInStreamlink, OPEN_IN_STREAMLINK}, + {ToastReaction::DontOpen, DONT_OPEN}}; bool Toasts::isEnabled() { @@ -42,7 +42,7 @@ bool Toasts::isEnabled() return false; } -QString Toasts::findStringFromReaction(const ToastReactions &reaction) +QString Toasts::findStringFromReaction(const ToastReaction &reaction) { auto iterator = Toasts::reactionToString.find(reaction); if (iterator != Toasts::reactionToString.end()) @@ -59,7 +59,7 @@ QString Toasts::findStringFromReaction( const pajlada::Settings::Setting &value) { int i = static_cast(value); - return Toasts::findStringFromReaction(static_cast(i)); + return Toasts::findStringFromReaction(static_cast(i)); } void Toasts::sendChannelNotification(const QString &channelName, Platform p) @@ -114,24 +114,24 @@ public: void toastActivated() const { QString link; - switch (static_cast( + switch (static_cast( getSettings()->openFromToast.getValue())) { - case ToastReactions::OpenInBrowser: + case ToastReaction::OpenInBrowser: if (platform_ == Platform::Twitch) { link = "http://www.twitch.tv/" + channelName_; } QDesktopServices::openUrl(QUrl(link)); break; - case ToastReactions::OpenInPlayer: + case ToastReaction::OpenInPlayer: if (platform_ == Platform::Twitch) { link = "https://player.twitch.tv/?channel=" + channelName_; } QDesktopServices::openUrl(QUrl(link)); break; - case ToastReactions::OpenInStreamlink: + case ToastReaction::OpenInStreamlink: { openStreamlinkForChannel(channelName_); break; @@ -163,8 +163,8 @@ void Toasts::sendWindowsNotification(const QString &channelName, Platform p) std::wstring widestr = std::wstring(utf8_text.begin(), utf8_text.end()); templ.setTextField(widestr, WinToastLib::WinToastTemplate::FirstLine); - if (static_cast(getSettings()->openFromToast.getValue()) != - ToastReactions::DontOpen) + if (static_cast(getSettings()->openFromToast.getValue()) != + ToastReaction::DontOpen) { QString mode = Toasts::findStringFromReaction(getSettings()->openFromToast); diff --git a/src/singletons/Toasts.hpp b/src/singletons/Toasts.hpp index 777cf04e2..43c6d1da8 100644 --- a/src/singletons/Toasts.hpp +++ b/src/singletons/Toasts.hpp @@ -7,7 +7,7 @@ namespace chatterino { enum class Platform : uint8_t; -enum class ToastReactions { +enum class ToastReaction { OpenInBrowser = 0, OpenInPlayer = 1, OpenInStreamlink = 2, @@ -18,10 +18,10 @@ class Toasts final : public Singleton { public: void sendChannelNotification(const QString &channelName, Platform p); - static QString findStringFromReaction(const ToastReactions &reaction); + static QString findStringFromReaction(const ToastReaction &reaction); static QString findStringFromReaction( const pajlada::Settings::Setting &reaction); - static std::map reactionToString; + static std::map reactionToString; static bool isEnabled(); diff --git a/src/widgets/settingspages/NotificationPage.cpp b/src/widgets/settingspages/NotificationPage.cpp index de7995885..74510f90c 100644 --- a/src/widgets/settingspages/NotificationPage.cpp +++ b/src/widgets/settingspages/NotificationPage.cpp @@ -139,10 +139,10 @@ QComboBox *NotificationPage::createToastReactionComboBox( { QComboBox *toastReactionOptions = new QComboBox(); - for (int i = 0; i <= static_cast(ToastReactions::DontOpen); i++) + for (int i = 0; i <= static_cast(ToastReaction::DontOpen); i++) { toastReactionOptions->insertItem( - i, Toasts::findStringFromReaction(static_cast(i))); + i, Toasts::findStringFromReaction(static_cast(i))); } // update when setting changes