From 0d4a45161ecf3f6ba2a89767c84ad0a84655f9c2 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sun, 18 May 2025 13:41:43 +0200 Subject: [PATCH] refactor: move `TimeoutStackStyle` to its own file (#6216) Co-authored-by: Mm2PL --- CHANGELOG.md | 1 + src/CMakeLists.txt | 5 +++-- src/common/Channel.hpp | 8 -------- src/common/TimeoutStackStyle.hpp | 11 +++++++++++ src/singletons/ImageUploader.cpp | 1 + src/singletons/Settings.hpp | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 src/common/TimeoutStackStyle.hpp diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f2f06f5..9c50d97a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - Dev: Bumped deprecation cutoff to Qt 6.4.3. (#6169) - Dev: Use `QMetaObject::invokeMethod` to run code on a specific thread. (#6203) - Dev: Added a `run-and-kill.sh` script to help debug crash-on-exit bugs. (#6188) +- Dev: Refactored the `TimeoutStackStyle` enum into its own file. (#6216) - Dev: Refactored event API initialization away from Application and into TwitchIrcServer. (#6198) - Dev: Updated GoogleTest to v1.17.0. (#6180) - Dev: Mini refactor of `TwitchAccount`. (#6182) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5eff9f92..f32b3dec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,10 +19,10 @@ set(SOURCE_FILES common/Args.cpp common/Args.hpp - common/Channel.cpp - common/Channel.hpp common/ChannelChatters.cpp common/ChannelChatters.hpp + common/Channel.cpp + common/Channel.hpp common/ChatterinoSetting.cpp common/ChatterinoSetting.hpp common/ChatterSet.cpp @@ -38,6 +38,7 @@ set(SOURCE_FILES common/Modes.hpp common/QLogging.cpp common/QLogging.hpp + common/TimeoutStackStyle.hpp common/WindowDescriptors.cpp common/WindowDescriptors.hpp diff --git a/src/common/Channel.hpp b/src/common/Channel.hpp index 41d5955e..02308dab 100644 --- a/src/common/Channel.hpp +++ b/src/common/Channel.hpp @@ -20,14 +20,6 @@ namespace chatterino { struct Message; using MessagePtr = std::shared_ptr; -enum class TimeoutStackStyle : int { - StackHard = 0, - DontStackBeyondUserMessage = 1, - DontStack = 2, - - Default = DontStackBeyondUserMessage, -}; - class Channel : public std::enable_shared_from_this, public MessageSink { public: diff --git a/src/common/TimeoutStackStyle.hpp b/src/common/TimeoutStackStyle.hpp new file mode 100644 index 00000000..42e12017 --- /dev/null +++ b/src/common/TimeoutStackStyle.hpp @@ -0,0 +1,11 @@ +namespace chatterino { + +enum class TimeoutStackStyle : int { + StackHard = 0, + DontStackBeyondUserMessage = 1, + DontStack = 2, + + Default = DontStackBeyondUserMessage, +}; + +} // namespace chatterino diff --git a/src/singletons/ImageUploader.cpp b/src/singletons/ImageUploader.cpp index d89b6a8d..27b648f2 100644 --- a/src/singletons/ImageUploader.cpp +++ b/src/singletons/ImageUploader.cpp @@ -1,6 +1,7 @@ #include "singletons/ImageUploader.hpp" #include "Application.hpp" +#include "common/Channel.hpp" #include "common/Env.hpp" #include "common/network/NetworkRequest.hpp" #include "common/network/NetworkResult.hpp" diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 60ad68a2..25e84c21 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -1,10 +1,10 @@ #pragma once -#include "common/Channel.hpp" #include "common/ChatterinoSetting.hpp" #include "common/enums/MessageOverflow.hpp" #include "common/Modes.hpp" #include "common/SignalVector.hpp" +#include "common/TimeoutStackStyle.hpp" #include "controllers/filters/FilterRecord.hpp" #include "controllers/highlights/HighlightBadge.hpp" #include "controllers/highlights/HighlightBlacklistUser.hpp"