Merge pull request #455 from LorenDB/fixLogoutIssues

Fix issues with logout
pull/465/head
DeepBlueV7.X 4 years ago committed by GitHub
commit 49ce7701d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/ChatPage.cpp
  2. 4
      src/UserSettingsPage.cpp
  3. 14
      src/Utils.cpp

@ -448,15 +448,15 @@ void
ChatPage::deleteConfigs()
{
QSettings settings;
if (UserSettings::instance()->profile() != "")
{
settings.beginGroup("profile");
settings.beginGroup(UserSettings::instance()->profile());
}
settings.beginGroup("auth");
settings.remove("");
settings.endGroup();
settings.beginGroup("client");
settings.remove("");
settings.endGroup();
settings.beginGroup("notifications");
settings.remove("");
settings.endGroup();
settings.endGroup(); // auth
http::client()->shutdown();
cache::deleteData();

@ -115,8 +115,8 @@ UserSettings::load(std::optional<QString> profile)
cameraFrameRate_ = settings.value("user/camera_frame_rate", QString()).toString();
useStunServer_ = settings.value("user/use_stun_server", false).toBool();
if (profile)
profile_ = *profile;
if (profile) // set to "" if it's the default to maintain compatibility
profile_ = (*profile == "default") ? "" : *profile;
else
profile_ = settings.value("user/currentProfile", "").toString();

@ -20,6 +20,7 @@
#include "Cache.h"
#include "Config.h"
#include "MatrixClient.h"
#include "UserSettingsPage.h"
using TimelineEvent = mtx::events::collections::TimelineEvents;
@ -65,14 +66,11 @@ utils::replaceEmoji(const QString &body)
QVector<uint> utf32_string = body.toUcs4();
QSettings settings;
QString userFontFamily = settings.value("user/emoji_font_family", "emoji").toString();
bool insideFontBlock = false;
for (auto &code : utf32_string) {
if (utils::codepointIsEmoji(code)) {
if (!insideFontBlock) {
fmtBody += QString("<font face=\"" + userFontFamily + "\">");
fmtBody += QString("<font face=\"" + UserSettings::instance()->font() + "\">");
insideFontBlock = true;
}
@ -505,13 +503,7 @@ utils::getQuoteBody(const RelatedInfo &related)
QString
utils::linkColor()
{
QSettings settings;
// Default to system theme if QT_QPA_PLATFORMTHEME var is set.
QString defaultTheme =
QProcessEnvironment::systemEnvironment().value("QT_QPA_PLATFORMTHEME", "").isEmpty()
? "light"
: "system";
const auto theme = settings.value("user/theme", defaultTheme).toString();
const auto theme = UserSettings::instance()->theme();
if (theme == "light") {
return "#0077b5";

Loading…
Cancel
Save