disabled the custom log path as it doesn't save in the proper

directories
This commit is contained in:
fourtf 2018-06-06 00:46:02 +02:00
parent 334f778f42
commit 714d3178d6
2 changed files with 36 additions and 34 deletions

View file

@ -39,7 +39,8 @@ void LoggingManager::addMessage(const QString &channelName, messages::MessagePtr
QString LoggingManager::getDirectoryForChannel(const QString &channelName) QString LoggingManager::getDirectoryForChannel(const QString &channelName)
{ {
auto customPath = getApp()->settings->logPath; // auto customPath = getApp()->settings->logPath;
auto customPath = QString("");
if (channelName.startsWith("/whispers")) { if (channelName.startsWith("/whispers")) {
if (customPath != "") if (customPath != "")

View file

@ -60,43 +60,44 @@ ModerationPage::ModerationPage()
logs.append(this->createCheckBox("Enable logging", app->settings->enableLogging)); logs.append(this->createCheckBox("Enable logging", app->settings->enableLogging));
logs->addStretch(1); logs->addStretch(1);
/*
auto selectDir = logs.emplace<QPushButton>("Set custom logpath");
auto selectDir = logs.emplace<QPushButton>("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 if (dirName == "" && dirMemory == "") {
QObject::connect( created->setText("Logs are saved to " +
selectDir.getElement(), &QPushButton::clicked, this, CreateLink(QStandardPaths::writableLocation(
[this, created, app, dirMemory = QString{app->settings->logPath}]() mutable { QStandardPaths::AppDataLocation),
auto dirName = QFileDialog::getExistingDirectory(this); true));
created->setText("Logs are saved to " + CreateLink(dirName, true)); } else if (dirName == "") {
dirName = dirMemory;
created->setText("Logs are saved to " + CreateLink(dirName, true));
}
if (dirName == "" && dirMemory == "") { app->settings->logPath = dirName;
created->setText("Logs are saved to " + dirMemory = dirName;
CreateLink(QStandardPaths::writableLocation( app->logging->refreshLoggingPath();
QStandardPaths::AppDataLocation), });
true)); // Reset custom logpath
} else if (dirName == "") { auto resetDir = logs.emplace<QPushButton>("Reset logpath");
dirName = dirMemory; QObject::connect(
created->setText("Logs are saved to " + CreateLink(dirName, true)); 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; // Logs end
dirMemory = dirName; */
app->logging->refreshLoggingPath();
});
// Reset custom logpath
auto resetDir = logs.emplace<QPushButton>("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
} }
auto modMode = tabs.appendTab(new QVBoxLayout, "Moderation mode"); auto modMode = tabs.appendTab(new QVBoxLayout, "Moderation mode");