fix: replace defines with constexpr/const and use more absolute paths for includes (#5527)
bye bye nuuls
This commit is contained in:
+13
-20
@@ -5,17 +5,17 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#define LINK_CHATTERINO_WIKI "https://wiki.chatterino.com"
|
||||
#define LINK_CHATTERINO_DISCORD "https://discord.gg/7Y5AYhAK4z"
|
||||
#define LINK_CHATTERINO_SOURCE "https://github.com/Chatterino/chatterino2"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
const inline auto TWITCH_PLAYER_URL =
|
||||
QStringLiteral("https://player.twitch.tv/?channel=%1&parent=twitch.tv");
|
||||
constexpr QStringView LINK_CHATTERINO_WIKI = u"https://wiki.chatterino.com";
|
||||
constexpr QStringView LINK_CHATTERINO_DISCORD =
|
||||
u"https://discord.gg/7Y5AYhAK4z";
|
||||
constexpr QStringView LINK_CHATTERINO_SOURCE =
|
||||
u"https://github.com/Chatterino/chatterino2";
|
||||
|
||||
constexpr QStringView TWITCH_PLAYER_URL =
|
||||
u"https://player.twitch.tv/?channel=%1&parent=twitch.tv";
|
||||
|
||||
enum class HighlightState {
|
||||
None,
|
||||
@@ -23,21 +23,14 @@ enum class HighlightState {
|
||||
NewMessage,
|
||||
};
|
||||
|
||||
const Qt::KeyboardModifiers showSplitOverlayModifiers =
|
||||
constexpr Qt::KeyboardModifiers SHOW_SPLIT_OVERLAY_MODIFIERS =
|
||||
Qt::ControlModifier | Qt::AltModifier;
|
||||
const Qt::KeyboardModifiers showAddSplitRegions =
|
||||
constexpr Qt::KeyboardModifiers SHOW_ADD_SPLIT_REGIONS =
|
||||
Qt::ControlModifier | Qt::AltModifier;
|
||||
const Qt::KeyboardModifiers showResizeHandlesModifiers = Qt::ControlModifier;
|
||||
constexpr Qt::KeyboardModifiers SHOW_RESIZE_HANDLES_MODIFIERS =
|
||||
Qt::ControlModifier;
|
||||
|
||||
#ifndef ATTR_UNUSED
|
||||
# ifdef Q_OS_WIN
|
||||
# define ATTR_UNUSED
|
||||
# else
|
||||
# define ATTR_UNUSED __attribute__((unused))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static const char *ANONYMOUS_USERNAME_LABEL ATTR_UNUSED = " - anonymous - ";
|
||||
constexpr const char *ANONYMOUS_USERNAME_LABEL = " - anonymous - ";
|
||||
|
||||
template <typename T>
|
||||
std::weak_ptr<T> weakOf(T *element)
|
||||
|
||||
Reference in New Issue
Block a user