From 714d3178d679e15ff0d12ce981709f1393e57ba3 Mon Sep 17 00:00:00 2001 From: fourtf Date: Wed, 6 Jun 2018 00:46:02 +0200 Subject: [PATCH] disabled the custom log path as it doesn't save in the proper directories --- src/singletons/loggingmanager.cpp | 3 +- src/widgets/settingspages/moderationpage.cpp | 67 ++++++++++---------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/singletons/loggingmanager.cpp b/src/singletons/loggingmanager.cpp index c921ddc66..9963d20c7 100644 --- a/src/singletons/loggingmanager.cpp +++ b/src/singletons/loggingmanager.cpp @@ -39,7 +39,8 @@ void LoggingManager::addMessage(const QString &channelName, messages::MessagePtr QString LoggingManager::getDirectoryForChannel(const QString &channelName) { - auto customPath = getApp()->settings->logPath; + // auto customPath = getApp()->settings->logPath; + auto customPath = QString(""); if (channelName.startsWith("/whispers")) { if (customPath != "") diff --git a/src/widgets/settingspages/moderationpage.cpp b/src/widgets/settingspages/moderationpage.cpp index 2c428ade7..d1c33c178 100644 --- a/src/widgets/settingspages/moderationpage.cpp +++ b/src/widgets/settingspages/moderationpage.cpp @@ -60,43 +60,44 @@ ModerationPage::ModerationPage() logs.append(this->createCheckBox("Enable logging", app->settings->enableLogging)); logs->addStretch(1); + /* +auto selectDir = logs.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)); - // 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; + 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; - created->setText("Logs are saved to " + CreateLink(dirName, true)); - } + app->settings->logPath = dirName; + dirMemory = dirName; + app->logging->refreshLoggingPath(); + }); +// Reset custom logpath +auto resetDir = logs.emplace("Reset logpath"); +QObject::connect( + resetDir.getElement(), &QPushButton::clicked, this, [this, created, app]() mutable { + app->settings->logPath = ""; + created->setText( + "Logs are saved to " + + CreateLink(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), + true)); + app->logging->refreshLoggingPath(); + }); - app->settings->logPath = dirName; - dirMemory = dirName; - app->logging->refreshLoggingPath(); - }); - // Reset custom logpath - auto resetDir = logs.emplace("Reset logpath"); - QObject::connect( - resetDir.getElement(), &QPushButton::clicked, this, [this, created, app]() mutable { - app->settings->logPath = ""; - created->setText( - "Logs are saved to " + - CreateLink(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), - true)); - app->logging->refreshLoggingPath(); - }); - - // Logs end +// Logs end +*/ } auto modMode = tabs.appendTab(new QVBoxLayout, "Moderation mode");