From d09b14db26d0a323ee309885f5a636e2137d6918 Mon Sep 17 00:00:00 2001 From: fourtf <tf.four@gmail.com> Date: Tue, 26 Jun 2018 17:25:24 +0200 Subject: [PATCH] removed Const.hpp and Credentials.hpp in favor of TwitchCommon.hpp --- chatterino.pro | 5 ++--- src/common/Common.hpp | 2 ++ src/common/UrlFetch.hpp | 2 +- src/providers/twitch/Const.hpp | 10 ---------- src/providers/twitch/TwitchAccount.cpp | 2 +- src/providers/twitch/TwitchAccountManager.cpp | 2 +- .../twitch/{Credentials.hpp => TwitchCommon.hpp} | 4 +++- src/widgets/AccountSwitchWidget.cpp | 3 ++- src/widgets/settingspages/AccountsPage.cpp | 2 +- 9 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 src/providers/twitch/Const.hpp rename src/providers/twitch/{Credentials.hpp => TwitchCommon.hpp} (65%) diff --git a/chatterino.pro b/chatterino.pro index a0642876a..ae9619853 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -280,8 +280,6 @@ HEADERS += \ src/providers/irc/IrcChannel2.hpp \ src/providers/irc/IrcConnection2.hpp \ src/providers/irc/IrcServer.hpp \ - src/providers/twitch/Const.hpp \ - src/providers/twitch/Credentials.hpp \ src/providers/twitch/EmoteValue.hpp \ src/providers/twitch/IrcMessageHandler.hpp \ src/providers/twitch/Pubsub.hpp \ @@ -385,7 +383,8 @@ HEADERS += \ src/widgets/splits/SplitOverlay.hpp \ src/widgets/StreamView.hpp \ src/widgets/TooltipWidget.hpp \ - src/widgets/Window.hpp + src/widgets/Window.hpp \ + src/providers/twitch/TwitchCommon.hpp RESOURCES += \ resources/resources.qrc \ diff --git a/src/common/Common.hpp b/src/common/Common.hpp index 78ce16578..fa413e179 100644 --- a/src/common/Common.hpp +++ b/src/common/Common.hpp @@ -25,4 +25,6 @@ const Qt::KeyboardModifiers showSplitOverlayModifiers = Qt::ControlModifier | Qt const Qt::KeyboardModifiers showAddSplitRegions = Qt::ControlModifier | Qt::AltModifier; const Qt::KeyboardModifiers showResizeHandlesModifiers = Qt::ControlModifier; +static const char *ANONYMOUS_USERNAME_LABEL ATTR_UNUSED = " - anonymous - "; + } // namespace chatterino diff --git a/src/common/UrlFetch.hpp b/src/common/UrlFetch.hpp index 3086bd3c3..df3fbdda6 100644 --- a/src/common/UrlFetch.hpp +++ b/src/common/UrlFetch.hpp @@ -4,7 +4,7 @@ #include "common/NetworkRequest.hpp" #include "controllers/accounts/AccountController.hpp" #include "debug/Log.hpp" -#include "providers/twitch/Credentials.hpp" +#include "providers/twitch/TwitchCommon.hpp" #include <rapidjson/document.h> #include <rapidjson/error/en.h> diff --git a/src/providers/twitch/Const.hpp b/src/providers/twitch/Const.hpp deleted file mode 100644 index d99bce191..000000000 --- a/src/providers/twitch/Const.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include <QString> - -namespace chatterino { - -static const char *ANONYMOUS_USERNAME_LABEL ATTR_UNUSED = " - anonymous - "; -static const char *ANONYMOUS_USERNAME ATTR_UNUSED = "justinfan64537"; - -} // namespace chatterino diff --git a/src/providers/twitch/TwitchAccount.cpp b/src/providers/twitch/TwitchAccount.cpp index 1654cad09..65e378de3 100644 --- a/src/providers/twitch/TwitchAccount.cpp +++ b/src/providers/twitch/TwitchAccount.cpp @@ -3,7 +3,7 @@ #include "common/NetworkRequest.hpp" #include "common/UrlFetch.hpp" #include "debug/Log.hpp" -#include "providers/twitch/Const.hpp" +#include "providers/twitch/TwitchCommon.hpp" #include "util/RapidjsonHelpers.hpp" namespace chatterino { diff --git a/src/providers/twitch/TwitchAccountManager.cpp b/src/providers/twitch/TwitchAccountManager.cpp index 11ccba948..24d75ef31 100644 --- a/src/providers/twitch/TwitchAccountManager.cpp +++ b/src/providers/twitch/TwitchAccountManager.cpp @@ -2,7 +2,7 @@ #include "common/Common.hpp" #include "debug/Log.hpp" -#include "providers/twitch/Const.hpp" +#include "providers/twitch/TwitchCommon.hpp" namespace chatterino { diff --git a/src/providers/twitch/Credentials.hpp b/src/providers/twitch/TwitchCommon.hpp similarity index 65% rename from src/providers/twitch/Credentials.hpp rename to src/providers/twitch/TwitchCommon.hpp index c0e97d259..af9db84f1 100644 --- a/src/providers/twitch/Credentials.hpp +++ b/src/providers/twitch/TwitchCommon.hpp @@ -1,9 +1,11 @@ #pragma once -#include <QByteArray> +#include <QString> namespace chatterino { +static const char *ANONYMOUS_USERNAME ATTR_UNUSED = "justinfan64537"; + inline QByteArray getDefaultClientID() { return QByteArray("7ue61iz46fz11y3cugd0l3tawb4taal"); diff --git a/src/widgets/AccountSwitchWidget.cpp b/src/widgets/AccountSwitchWidget.cpp index 115b234b3..3b2acc268 100644 --- a/src/widgets/AccountSwitchWidget.cpp +++ b/src/widgets/AccountSwitchWidget.cpp @@ -1,8 +1,9 @@ #include "AccountSwitchWidget.hpp" #include "Application.hpp" +#include "common/Common.hpp" #include "controllers/accounts/AccountController.hpp" -#include "providers/twitch/Const.hpp" +#include "providers/twitch/TwitchCommon.hpp" namespace chatterino { diff --git a/src/widgets/settingspages/AccountsPage.cpp b/src/widgets/settingspages/AccountsPage.cpp index ca9ff0258..7d1eb3368 100644 --- a/src/widgets/settingspages/AccountsPage.cpp +++ b/src/widgets/settingspages/AccountsPage.cpp @@ -3,7 +3,7 @@ #include "Application.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/accounts/AccountModel.hpp" -#include "providers/twitch/Const.hpp" +#include "providers/twitch/TwitchCommon.hpp" #include "util/LayoutCreator.hpp" #include "widgets/dialogs/LoginDialog.hpp" #include "widgets/helper/EditableModelView.hpp"