fix: replace defines with constexpr/const and use more absolute paths for includes (#5527)

bye bye nuuls
This commit is contained in:
nerix
2024-08-03 12:00:58 +02:00
committed by GitHub
parent 5ee5abf5b2
commit aed55ac1ba
83 changed files with 386 additions and 380 deletions
+9 -7
View File
@@ -1,6 +1,7 @@
#include "CommandPage.hpp"
#include "widgets/settingspages/CommandPage.hpp"
#include "Application.hpp"
#include "common/Literals.hpp"
#include "controllers/commands/Command.hpp"
#include "controllers/commands/CommandController.hpp"
#include "controllers/commands/CommandModel.hpp"
@@ -18,13 +19,14 @@
#include <QTableView>
#include <QTextEdit>
// clang-format off
#define TEXT "{1} => first word &nbsp;&nbsp;&nbsp; {1+} => first word and after &nbsp;&nbsp;&nbsp; {{ => { &nbsp;&nbsp;&nbsp; <a href='https://chatterino.com/help/commands'>more info</a>"
// clang-format on
namespace {
using namespace chatterino;
using namespace literals;
// clang-format off
inline const QString HELP_TEXT = u"{1} => first word &nbsp;&nbsp;&nbsp; {1+} => first word and after &nbsp;&nbsp;&nbsp; {{ => { &nbsp;&nbsp;&nbsp; <a href='https://chatterino.com/help/commands'>more info</a>"_s;
// clang-format on
QString c1settingsPath()
{
@@ -106,7 +108,7 @@ CommandPage::CommandPage()
view->addCustomButton(button);
QObject::connect(button, &QPushButton::clicked, this, [] {
QFile c1settings = c1settingsPath();
QFile c1settings(c1settingsPath());
c1settings.open(QIODevice::ReadOnly);
for (auto line :
QString(c1settings.readAll())
@@ -125,7 +127,7 @@ CommandPage::CommandPage()
this->createCheckBox("Also match the trigger at the end of the message",
getSettings()->allowCommandsAtEnd));
QLabel *text = layout.emplace<QLabel>(TEXT).getElement();
QLabel *text = layout.emplace<QLabel>(HELP_TEXT).getElement();
text->setWordWrap(true);
text->setStyleSheet("color: #bbb");
text->setOpenExternalLinks(true);