mirror of https://github.com/procxx/kepka.git
Fix admin stars disappearing in members list.
This commit is contained in:
parent
76f951e3e6
commit
116e3fd9c5
|
@ -260,7 +260,7 @@ void PeerListController::setSearchNoResultsText(const QString &text) {
|
|||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<PeerListState> PeerListController::saveState() {
|
||||
std::unique_ptr<PeerListState> PeerListController::saveState() const {
|
||||
return delegate()->peerListSaveState();
|
||||
}
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
|
||||
virtual int peerListSelectedRowsCount() = 0;
|
||||
virtual std::vector<not_null<PeerData*>> peerListCollectSelectedRows() = 0;
|
||||
virtual std::unique_ptr<PeerListState> peerListSaveState() = 0;
|
||||
virtual std::unique_ptr<PeerListState> peerListSaveState() const = 0;
|
||||
virtual void peerListRestoreState(
|
||||
std::unique_ptr<PeerListState> state) = 0;
|
||||
virtual ~PeerListDelegate() = default;
|
||||
|
@ -299,7 +299,7 @@ public:
|
|||
_delegate = delegate;
|
||||
}
|
||||
|
||||
virtual std::unique_ptr<SavedStateBase> saveState() {
|
||||
virtual std::unique_ptr<SavedStateBase> saveState() const {
|
||||
return nullptr;
|
||||
}
|
||||
virtual void restoreState(
|
||||
|
@ -354,7 +354,7 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
virtual std::unique_ptr<PeerListState> saveState();
|
||||
virtual std::unique_ptr<PeerListState> saveState() const ;
|
||||
virtual void restoreState(
|
||||
std::unique_ptr<PeerListState> state);
|
||||
|
||||
|
@ -714,7 +714,7 @@ public:
|
|||
});
|
||||
return result;
|
||||
}
|
||||
std::unique_ptr<PeerListState> peerListSaveState() override {
|
||||
std::unique_ptr<PeerListState> peerListSaveState() const override {
|
||||
return _content->saveState();
|
||||
}
|
||||
void peerListRestoreState(
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
return createRow(peer);
|
||||
}
|
||||
|
||||
std::unique_ptr<PeerListState> saveState() override;
|
||||
std::unique_ptr<PeerListState> saveState() const override;
|
||||
void restoreState(std::unique_ptr<PeerListState> state) override;
|
||||
|
||||
private:
|
||||
|
@ -132,15 +132,12 @@ void ListController::loadMoreRows() {
|
|||
}).send();
|
||||
}
|
||||
|
||||
std::unique_ptr<PeerListState> ListController::saveState() {
|
||||
std::unique_ptr<PeerListState> ListController::saveState() const {
|
||||
auto result = PeerListController::saveState();
|
||||
auto my = std::make_unique<SavedState>();
|
||||
my->preloadGroupId = _preloadGroupId;
|
||||
my->allLoaded = _allLoaded;
|
||||
if (auto requestId = base::take(_preloadRequestId)) {
|
||||
request(requestId).cancel();
|
||||
my->wasLoading = true;
|
||||
}
|
||||
my->wasLoading = (_preloadRequestId != 0);
|
||||
result->controllerState = std::move(my);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
std::unique_ptr<PeerListRow> createRestoredRow(
|
||||
not_null<PeerData*> peer) override;
|
||||
|
||||
std::unique_ptr<PeerListState> saveState() override;
|
||||
std::unique_ptr<PeerListState> saveState() const override;
|
||||
void restoreState(std::unique_ptr<PeerListState> state) override;
|
||||
|
||||
private:
|
||||
|
@ -147,7 +147,7 @@ void ChatMembersController::sortByOnline() {
|
|||
refreshOnlineCount();
|
||||
}
|
||||
|
||||
std::unique_ptr<PeerListState> ChatMembersController::saveState() {
|
||||
std::unique_ptr<PeerListState> ChatMembersController::saveState() const {
|
||||
auto result = PeerListController::saveState();
|
||||
auto my = std::make_unique<SavedState>();
|
||||
using Flag = Notify::PeerUpdate::Flag;
|
||||
|
|
|
@ -253,19 +253,16 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createRestoredRow(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<PeerListState> ParticipantsBoxController::saveState() {
|
||||
std::unique_ptr<PeerListState> ParticipantsBoxController::saveState() const {
|
||||
Expects(_role == Role::Profile);
|
||||
|
||||
auto result = PeerListController::saveState();
|
||||
|
||||
auto my = std::make_unique<SavedState>();
|
||||
my->additional = std::move(_additional);
|
||||
my->additional = _additional;
|
||||
my->offset = _offset;
|
||||
my->allLoaded = _allLoaded;
|
||||
if (auto requestId = base::take(_loadRequestId)) {
|
||||
request(requestId).cancel();
|
||||
my->wasLoading = true;
|
||||
}
|
||||
my->wasLoading = (_loadRequestId != 0);
|
||||
if (auto search = searchController()) {
|
||||
my->searchState = search->saveState();
|
||||
}
|
||||
|
@ -982,16 +979,13 @@ void ParticipantsBoxSearchController::searchQuery(const QString &query) {
|
|||
}
|
||||
}
|
||||
|
||||
auto ParticipantsBoxSearchController::saveState()
|
||||
auto ParticipantsBoxSearchController::saveState() const
|
||||
-> std::unique_ptr<SavedStateBase> {
|
||||
auto result = std::make_unique<SavedState>();
|
||||
result->query = _query;
|
||||
result->offset = _offset;
|
||||
result->allLoaded = _allLoaded;
|
||||
if (auto requestId = base::take(_requestId)) {
|
||||
request(requestId).cancel();
|
||||
result->wasLoading = true;
|
||||
}
|
||||
result->wasLoading = (_requestId != 0);
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
std::unique_ptr<PeerListRow> createRestoredRow(
|
||||
not_null<PeerData*> peer) override;
|
||||
|
||||
std::unique_ptr<PeerListState> saveState() override;
|
||||
std::unique_ptr<PeerListState> saveState() const override;
|
||||
void restoreState(std::unique_ptr<PeerListState> state) override;
|
||||
|
||||
// Callback(not_null<UserData*>)
|
||||
|
@ -171,7 +171,7 @@ public:
|
|||
bool isLoading() override;
|
||||
bool loadMoreRows() override;
|
||||
|
||||
std::unique_ptr<SavedStateBase> saveState() override;
|
||||
std::unique_ptr<SavedStateBase> saveState() const override;
|
||||
void restoreState(std::unique_ptr<SavedStateBase> state) override;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue