From d99fa70e86b19edc0dac70a5aa7108d8f63e2248 Mon Sep 17 00:00:00 2001 From: Matt Traudt Date: Mon, 21 Mar 2016 23:41:24 -0500 Subject: [PATCH] Make chat window combined by default --- src/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 0bc4e0b9..99c9c0e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,6 +128,13 @@ static QString appBundlePath() } #endif +// Writes default settings to settings object. Does not care about any +// preexisting values, therefore this is best used on a fresh object. +static void loadDefaultSettings(SettingsFile *settings) +{ + settings->root()->write("ui.combinedChatWindow", true); +} + static bool initSettings(SettingsFile *settings, QLockFile **lockFile, QString &errorMessage) { /* If built in portable mode (default), configuration is stored in the 'config' @@ -206,6 +213,10 @@ static bool initSettings(SettingsFile *settings, QLockFile **lockFile, QString & if (QFile::exists(filePath)) importLegacySettings(settings, filePath); } + // if still empty, load defaults here + if (settings->root()->data().isEmpty()) { + loadDefaultSettings(settings); + } return true; }