Perform initial refactoring work

Things that were once singletons are no longer singletons, but are
instead stored in the "Application" singleton

Some singletons still remain, and some renaming/renamespacing is left
This commit is contained in:
Rasmus Karlsson
2018-04-27 22:11:19 +02:00
parent 32b6417a55
commit ae26b835b6
78 changed files with 850 additions and 773 deletions
+6 -4
View File
@@ -1,4 +1,6 @@
#include "logspage.hpp"
#include "application.hpp"
#include "singletons/pathmanager.hpp"
#include <QFormLayout>
@@ -23,12 +25,12 @@ inline QString CreateLink(const QString &url, bool file = false)
LogsPage::LogsPage()
: SettingsPage("Logs", "")
{
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
auto app = getApp();
util::LayoutCreator<LogsPage> layoutCreator(this);
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
singletons::PathManager &pathManager = singletons::PathManager::getInstance();
auto logPath = pathManager.logsFolderPath;
auto logPath = app->paths->logsFolderPath;
auto created = layout.emplace<QLabel>();
created->setText("Logs are saved to " + CreateLink(logPath, true));
@@ -36,7 +38,7 @@ LogsPage::LogsPage()
created->setTextInteractionFlags(Qt::TextBrowserInteraction | Qt::LinksAccessibleByKeyboard |
Qt::LinksAccessibleByKeyboard);
created->setOpenExternalLinks(true);
layout.append(this->createCheckBox("Enable logging", settings.enableLogging));
layout.append(this->createCheckBox("Enable logging", app->settings->enableLogging));
layout->addStretch(1);
}