2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 23:55:12 +00:00

Notifications management moved to AuthSession.

Also implemented Global::WorkMode() as an base::Variable.
This commit is contained in:
John Preston
2017-03-04 22:36:59 +03:00
parent b14ba398e6
commit 81790b2271
80 changed files with 1299 additions and 1152 deletions

View File

@@ -42,6 +42,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "history/history_service_layout.h"
#include "media/media_audio.h"
#include "observer_peer.h"
#include "auth_session.h"
#include "storage/file_download.h"
// flick scroll taken from http://qt-project.org/doc/qt-4.8/demos-embedded-anomaly-src-flickcharm-cpp.html
@@ -59,7 +61,7 @@ OverviewInner::OverviewInner(OverviewWidget *overview, Ui::ScrollArea *scroll, P
, _cancelSearch(this, st::dialogsCancelSearch)
, _itemsToBeLoaded(LinksOverviewPerPage * 2)
, _width(st::windowMinWidth) {
subscribe(FileDownload::ImageLoaded(), [this] { update(); });
subscribe(AuthSession::Current().downloader()->taskFinished(), [this] { update(); });
subscribe(Global::RefItemRemoved(), [this](HistoryItem *item) {
itemRemoved(item);
});
@@ -1917,7 +1919,7 @@ void OverviewWidget::clear() {
}
void OverviewWidget::onScroll() {
MTP::clearLoaderPriorities();
AuthSession::Current().downloader()->clearPriorities();
int32 preloadThreshold = _scroll->height() * 5;
bool needToPreload = false;
do {