mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Merge pull request #455 from LorenDB/fixLogoutIssues
Fix issues with logout
This commit is contained in:
commit
49ce7701d3
3 changed files with 12 additions and 20 deletions
|
@ -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…
Reference in a new issue