diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-09-02 12:38:21 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-09-02 12:38:21 +0200 |
commit | de6225509a584df31be1b28146e73d8ecf72c7eb (patch) | |
tree | 853f04d227e47f3685d156d0d4fb43a51723dba7 /src/profilemanager.cpp | |
parent | PluginEditor: implement add plugin action (diff) | |
download | smolbote-de6225509a584df31be1b28146e73d8ecf72c7eb.tar.xz |
Clean up ProfileManager
Diffstat (limited to 'src/profilemanager.cpp')
-rw-r--r-- | src/profilemanager.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/profilemanager.cpp b/src/profilemanager.cpp index 1038598..5b0f76e 100644 --- a/src/profilemanager.cpp +++ b/src/profilemanager.cpp @@ -12,13 +12,26 @@ #include <QFileInfo> #include <QWebEngineSettings> -QMap<QString, WebProfile *> ProfileManager::profiles; +ProfileManager *ProfileManager::s_instance = nullptr; -ProfileManager::ProfileManager(QObject *parent) : QObject(parent) +ProfileManager::ProfileManager(const QHash<QString, QString> &profileSection, QObject *parent) : QObject(parent) + , defaults(profileSection) { } -WebProfile *ProfileManager::loadProfile(const QString &path, const QHash<QString, QString> &defaults) +void ProfileManager::setInstance(ProfileManager *instance) +{ + Q_CHECK_PTR(instance); + s_instance = instance; +} + +ProfileManager *ProfileManager::instance() +{ + Q_CHECK_PTR(s_instance); + return s_instance; +} + +WebProfile *ProfileManager::loadProfile(const QString &path) { WebProfile *profile = nullptr; #ifdef QT_DEBUG |