mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Move session data localstorage -> storage_account.
This commit is contained in:
@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "main/main_session.h"
|
||||
#include "apiwrap.h"
|
||||
#include "storage/localstorage.h"
|
||||
#include "storage/storage_account.h"
|
||||
#include "storage/localimageloader.h"
|
||||
#include "storage/file_upload.h"
|
||||
#include "base/parse_helper.h"
|
||||
@@ -529,6 +530,10 @@ ChatBackground::ChatBackground() : _adjustableColors({
|
||||
});
|
||||
}
|
||||
|
||||
Storage::Account &ChatBackground::local() const {
|
||||
return Core::App().activeAccount().local();
|
||||
}
|
||||
|
||||
void ChatBackground::setThemeData(QImage &&themeImage, bool themeTile) {
|
||||
_themeImage = validateBackgroundImage(std::move(themeImage));
|
||||
_themeTile = themeTile;
|
||||
@@ -538,7 +543,7 @@ void ChatBackground::start() {
|
||||
if (!Data::details::IsUninitializedWallPaper(_paper)) {
|
||||
return;
|
||||
}
|
||||
if (!Local::readBackground()) {
|
||||
if (!local().readBackground()) {
|
||||
set(Data::ThemeWallPaper());
|
||||
}
|
||||
|
||||
@@ -653,7 +658,7 @@ void ChatBackground::set(const Data::WallPaper &paper, QImage image) {
|
||||
setPaper(Data::DefaultWallPaper().withParamsFrom(_paper));
|
||||
image.load(qsl(":/gui/art/bg.jpg"));
|
||||
}
|
||||
Local::writeBackground(
|
||||
local().writeBackground(
|
||||
_paper,
|
||||
((Data::IsDefaultWallPaper(_paper)
|
||||
|| Data::IsLegacy1DefaultWallPaper(_paper))
|
||||
@@ -869,7 +874,7 @@ void ChatBackground::setTile(bool tile) {
|
||||
if (this->tile() != old) {
|
||||
if (!Data::details::IsTestingThemeWallPaper(_paper)
|
||||
&& !Data::details::IsTestingDefaultWallPaper(_paper)) {
|
||||
Local::writeUserSettings();
|
||||
local().writeSettings();
|
||||
}
|
||||
notify(BackgroundUpdate(BackgroundUpdate::Type::Changed, tile));
|
||||
}
|
||||
@@ -1024,9 +1029,9 @@ bool ChatBackground::isNonDefaultBackground() {
|
||||
|
||||
void ChatBackground::writeNewBackgroundSettings() {
|
||||
if (tile() != _tileForRevert) {
|
||||
Local::writeUserSettings();
|
||||
local().writeSettings();
|
||||
}
|
||||
Local::writeBackground(
|
||||
local().writeBackground(
|
||||
_paper,
|
||||
((Data::IsThemeWallPaper(_paper)
|
||||
|| Data::IsDefaultWallPaper(_paper))
|
||||
@@ -1111,12 +1116,12 @@ void ChatBackground::reapplyWithNightMode(
|
||||
ClearApplying();
|
||||
keepApplied(saved.object, settingExactTheme);
|
||||
if (tile() != _tileForRevert) {
|
||||
Local::writeUserSettings();
|
||||
local().writeSettings();
|
||||
}
|
||||
if (nightModeChanged) {
|
||||
Local::writeSettings();
|
||||
}
|
||||
if (!settingExactTheme && !Local::readBackground()) {
|
||||
if (!settingExactTheme && !local().readBackground()) {
|
||||
set(Data::ThemeWallPaper());
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user