fix: replace defines with constexpr/const and use more absolute paths for includes (#5527)
bye bye nuuls
This commit is contained in:
@@ -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 {1+} => first word and after {{ => { <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 {1+} => first word and after {{ => { <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);
|
||||
|
||||
Reference in New Issue
Block a user