diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-09 12:05:28 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-09 12:05:28 +0200 |
commit | 3639d5789259561c531a3481d7061a0cb492c644 (patch) | |
tree | c9c7ff04022b62cf5be4d4ea31bf28d966ccefda /lib/web/profilemanager.cpp | |
parent | Create .profile file when adding a new profile (diff) | |
download | smolbote-3639d5789259561c531a3481d7061a0cb492c644.tar.xz |
Unlink plugins from lib/ libraries
Diffstat (limited to 'lib/web/profilemanager.cpp')
-rw-r--r-- | lib/web/profilemanager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/web/profilemanager.cpp b/lib/web/profilemanager.cpp index 17435e8..14795cd 100644 --- a/lib/web/profilemanager.cpp +++ b/lib/web/profilemanager.cpp @@ -17,6 +17,19 @@ ProfileManager::ProfileManager(const QHash<QString, QString> &profileSection, QO { } +WebProfile *ProfileManager::createProfile(const QString& id, bool isOffTheRecord) +{ + QDir profileDir(defaults.value("profile.path")); + const QString path = profileDir.absoluteFilePath(id + ".profile"); + { + QSettings init(path, QSettings::IniFormat); + init.setValue("name", id); + init.setValue("otr", isOffTheRecord); + init.sync(); + } + return loadProfile(path); +} + WebProfile *ProfileManager::loadProfile(const QString &path) { std::unique_ptr<ProfileData> ptr = std::make_unique<ProfileData>(path); |