aboutsummaryrefslogtreecommitdiff
path: root/lib/web/profilemanager.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-09 12:05:28 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-09 12:05:28 +0200
commit3639d5789259561c531a3481d7061a0cb492c644 (patch)
treec9c7ff04022b62cf5be4d4ea31bf28d966ccefda /lib/web/profilemanager.cpp
parentCreate .profile file when adding a new profile (diff)
downloadsmolbote-3639d5789259561c531a3481d7061a0cb492c644.tar.xz
Unlink plugins from lib/ libraries
Diffstat (limited to 'lib/web/profilemanager.cpp')
-rw-r--r--lib/web/profilemanager.cpp13
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);