Skip to content

Commit

Permalink
Merge pull request ricochet-im#391 from dmS0Zq/default-combined-chat
Browse files Browse the repository at this point in the history
Make chat window combined by default
  • Loading branch information
special committed Apr 8, 2016
2 parents 92d9d3d + d99fa70 commit e3e5f79
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,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'
Expand Down Expand Up @@ -211,6 +218,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;
}
Expand Down

0 comments on commit e3e5f79

Please sign in to comment.