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();
|
return delegate()->peerListSaveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,7 @@ public:
|
||||||
|
|
||||||
virtual int peerListSelectedRowsCount() = 0;
|
virtual int peerListSelectedRowsCount() = 0;
|
||||||
virtual std::vector<not_null<PeerData*>> peerListCollectSelectedRows() = 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(
|
virtual void peerListRestoreState(
|
||||||
std::unique_ptr<PeerListState> state) = 0;
|
std::unique_ptr<PeerListState> state) = 0;
|
||||||
virtual ~PeerListDelegate() = default;
|
virtual ~PeerListDelegate() = default;
|
||||||
|
@ -299,7 +299,7 @@ public:
|
||||||
_delegate = delegate;
|
_delegate = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::unique_ptr<SavedStateBase> saveState() {
|
virtual std::unique_ptr<SavedStateBase> saveState() const {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
virtual void restoreState(
|
virtual void restoreState(
|
||||||
|
@ -354,7 +354,7 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::unique_ptr<PeerListState> saveState();
|
virtual std::unique_ptr<PeerListState> saveState() const ;
|
||||||
virtual void restoreState(
|
virtual void restoreState(
|
||||||
std::unique_ptr<PeerListState> state);
|
std::unique_ptr<PeerListState> state);
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ public:
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
std::unique_ptr<PeerListState> peerListSaveState() override {
|
std::unique_ptr<PeerListState> peerListSaveState() const override {
|
||||||
return _content->saveState();
|
return _content->saveState();
|
||||||
}
|
}
|
||||||
void peerListRestoreState(
|
void peerListRestoreState(
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
return createRow(peer);
|
return createRow(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PeerListState> saveState() override;
|
std::unique_ptr<PeerListState> saveState() const override;
|
||||||
void restoreState(std::unique_ptr<PeerListState> state) override;
|
void restoreState(std::unique_ptr<PeerListState> state) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -132,15 +132,12 @@ void ListController::loadMoreRows() {
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PeerListState> ListController::saveState() {
|
std::unique_ptr<PeerListState> ListController::saveState() const {
|
||||||
auto result = PeerListController::saveState();
|
auto result = PeerListController::saveState();
|
||||||
auto my = std::make_unique<SavedState>();
|
auto my = std::make_unique<SavedState>();
|
||||||
my->preloadGroupId = _preloadGroupId;
|
my->preloadGroupId = _preloadGroupId;
|
||||||
my->allLoaded = _allLoaded;
|
my->allLoaded = _allLoaded;
|
||||||
if (auto requestId = base::take(_preloadRequestId)) {
|
my->wasLoading = (_preloadRequestId != 0);
|
||||||
request(requestId).cancel();
|
|
||||||
my->wasLoading = true;
|
|
||||||
}
|
|
||||||
result->controllerState = std::move(my);
|
result->controllerState = std::move(my);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
std::unique_ptr<PeerListRow> createRestoredRow(
|
std::unique_ptr<PeerListRow> createRestoredRow(
|
||||||
not_null<PeerData*> peer) override;
|
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;
|
void restoreState(std::unique_ptr<PeerListState> state) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -147,7 +147,7 @@ void ChatMembersController::sortByOnline() {
|
||||||
refreshOnlineCount();
|
refreshOnlineCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PeerListState> ChatMembersController::saveState() {
|
std::unique_ptr<PeerListState> ChatMembersController::saveState() const {
|
||||||
auto result = PeerListController::saveState();
|
auto result = PeerListController::saveState();
|
||||||
auto my = std::make_unique<SavedState>();
|
auto my = std::make_unique<SavedState>();
|
||||||
using Flag = Notify::PeerUpdate::Flag;
|
using Flag = Notify::PeerUpdate::Flag;
|
||||||
|
|
|
@ -253,19 +253,16 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createRestoredRow(
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PeerListState> ParticipantsBoxController::saveState() {
|
std::unique_ptr<PeerListState> ParticipantsBoxController::saveState() const {
|
||||||
Expects(_role == Role::Profile);
|
Expects(_role == Role::Profile);
|
||||||
|
|
||||||
auto result = PeerListController::saveState();
|
auto result = PeerListController::saveState();
|
||||||
|
|
||||||
auto my = std::make_unique<SavedState>();
|
auto my = std::make_unique<SavedState>();
|
||||||
my->additional = std::move(_additional);
|
my->additional = _additional;
|
||||||
my->offset = _offset;
|
my->offset = _offset;
|
||||||
my->allLoaded = _allLoaded;
|
my->allLoaded = _allLoaded;
|
||||||
if (auto requestId = base::take(_loadRequestId)) {
|
my->wasLoading = (_loadRequestId != 0);
|
||||||
request(requestId).cancel();
|
|
||||||
my->wasLoading = true;
|
|
||||||
}
|
|
||||||
if (auto search = searchController()) {
|
if (auto search = searchController()) {
|
||||||
my->searchState = search->saveState();
|
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> {
|
-> std::unique_ptr<SavedStateBase> {
|
||||||
auto result = std::make_unique<SavedState>();
|
auto result = std::make_unique<SavedState>();
|
||||||
result->query = _query;
|
result->query = _query;
|
||||||
result->offset = _offset;
|
result->offset = _offset;
|
||||||
result->allLoaded = _allLoaded;
|
result->allLoaded = _allLoaded;
|
||||||
if (auto requestId = base::take(_requestId)) {
|
result->wasLoading = (_requestId != 0);
|
||||||
request(requestId).cancel();
|
|
||||||
result->wasLoading = true;
|
|
||||||
}
|
|
||||||
return std::move(result);
|
return std::move(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ public:
|
||||||
std::unique_ptr<PeerListRow> createRestoredRow(
|
std::unique_ptr<PeerListRow> createRestoredRow(
|
||||||
not_null<PeerData*> peer) override;
|
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;
|
void restoreState(std::unique_ptr<PeerListState> state) override;
|
||||||
|
|
||||||
// Callback(not_null<UserData*>)
|
// Callback(not_null<UserData*>)
|
||||||
|
@ -171,7 +171,7 @@ public:
|
||||||
bool isLoading() override;
|
bool isLoading() override;
|
||||||
bool loadMoreRows() 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;
|
void restoreState(std::unique_ptr<SavedStateBase> state) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue