summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-12-27 22:56:43 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-12-27 22:56:54 +0100
commit391b1b32856a5964e429fd95ab588a5e9e745801 (patch)
tree2dd2e32746c5a0efa053418c1ad80645290c7550 /src/main.cpp
parentExpose appimage (diff)
downloadnheko-391b1b32856a5964e429fd95ab588a5e9e745801.tar.xz
Fix #359
Actually store the login details under the selected profile
Diffstat (limited to '')
-rw-r--r--src/main.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 58bdda34..a60c66c4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -196,17 +196,19 @@ main(int argc, char *argv[])
                 std::exit(1);
         }
 
-        UserSettings settings;
-
         if (parser.isSet(configName))
-                settings.setProfile(parser.value(configName));
+                UserSettings::initialize(parser.value(configName));
+        else
+                UserSettings::initialize(std::nullopt);
+
+        auto settings = UserSettings::instance().toWeakRef();
 
         QFont font;
-        QString userFontFamily = settings.font();
+        QString userFontFamily = settings.lock()->font();
         if (!userFontFamily.isEmpty()) {
                 font.setFamily(userFontFamily);
         }
-        font.setPointSizeF(settings.fontSize());
+        font.setPointSizeF(settings.lock()->fontSize());
 
         app.setFont(font);
 
@@ -226,7 +228,7 @@ main(int argc, char *argv[])
         // Move the MainWindow to the center
         w.move(screenCenter(w.width(), w.height()));
 
-        if (!settings.startInTray() && !settings.tray())
+        if (!settings.lock()->startInTray() && !settings.lock()->tray())
                 w.show();
 
         QObject::connect(&app, &QApplication::aboutToQuit, &w, [&w]() {