diff --git a/src/widgets/settingspages/moderationpage.cpp b/src/widgets/settingspages/moderationpage.cpp index 29a154b19..2c428ade7 100644 --- a/src/widgets/settingspages/moderationpage.cpp +++ b/src/widgets/settingspages/moderationpage.cpp @@ -1,9 +1,9 @@ #include "moderationpage.hpp" #include "application.hpp" -#include "singletons/loggingmanager.hpp" #include "controllers/taggedusers/taggeduserscontroller.hpp" #include "controllers/taggedusers/taggedusersmodel.hpp" +#include "singletons/loggingmanager.hpp" #include "singletons/pathmanager.hpp" #include "util/layoutcreator.hpp" #include "widgets/helper/editablemodelview.hpp" @@ -59,35 +59,33 @@ ModerationPage::ModerationPage() created->setOpenExternalLinks(true); logs.append(this->createCheckBox("Enable logging", app->settings->enableLogging)); -< logs->addStretch(1); - auto selectDir = layout.emplace("Set custom logpath"); + auto selectDir = logs.emplace("Set custom logpath"); // Setting custom logpath - QObject::connect(selectDir.getElement(), &QPushButton::clicked, this, [ - this, created, app, dirMemory = QString{app->settings->logPath} - ]() mutable { - auto dirName = QFileDialog::getExistingDirectory(this); - created->setText("Logs are saved to " + CreateLink(dirName, true)); - - if (dirName == "" && dirMemory == "") { - created->setText( - "Logs are saved to " + - CreateLink(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), - true)); - } else if (dirName == "") { - dirName = dirMemory; + QObject::connect( + selectDir.getElement(), &QPushButton::clicked, this, + [this, created, app, dirMemory = QString{app->settings->logPath}]() mutable { + auto dirName = QFileDialog::getExistingDirectory(this); created->setText("Logs are saved to " + CreateLink(dirName, true)); - } - app->settings->logPath = dirName; - dirMemory = dirName; - app->logging->refreshLoggingPath(); + if (dirName == "" && dirMemory == "") { + created->setText("Logs are saved to " + + CreateLink(QStandardPaths::writableLocation( + QStandardPaths::AppDataLocation), + true)); + } else if (dirName == "") { + dirName = dirMemory; + created->setText("Logs are saved to " + CreateLink(dirName, true)); + } - }); + app->settings->logPath = dirName; + dirMemory = dirName; + app->logging->refreshLoggingPath(); + }); // Reset custom logpath - auto resetDir = layout.emplace("Reset logpath"); + auto resetDir = logs.emplace("Reset logpath"); QObject::connect( resetDir.getElement(), &QPushButton::clicked, this, [this, created, app]() mutable { app->settings->logPath = "";