Removed Q_OBJECT from GroupMembersWidget.

Removed unused onlineCountUpdated since d93c1ccbaa.
This commit is contained in:
23rd 2021-06-16 09:05:13 +03:00 committed by John Preston
parent 7924979dfb
commit beaa4190eb
2 changed files with 8 additions and 17 deletions

View File

@ -44,10 +44,8 @@ GroupMembersWidget::GroupMembersWidget(
QWidget *parent,
not_null<PeerData*> peer,
const style::PeerListItem &st)
: PeerListWidget(parent, peer, QString(), st, tr::lng_profile_kick(tr::now)) {
_updateOnlineTimer.setSingleShot(true);
connect(&_updateOnlineTimer, SIGNAL(timeout()), this, SLOT(onUpdateOnlineDisplay()));
: PeerListWidget(parent, peer, QString(), st, tr::lng_profile_kick(tr::now))
, _updateOnlineTimer([=] { updateOnlineDisplay(); }) {
peer->session().changes().peerUpdates(
UpdateFlag::Admins
| UpdateFlag::Members
@ -186,7 +184,7 @@ void GroupMembersWidget::updateItemStatusText(Item *item) {
}
if (_updateOnlineAt <= _now || _updateOnlineAt > member->onlineTextTill) {
_updateOnlineAt = member->onlineTextTill;
_updateOnlineTimer.start((_updateOnlineAt - _now + 1) * 1000);
_updateOnlineTimer.callOnce((_updateOnlineAt - _now + 1) * 1000);
}
}
@ -256,7 +254,6 @@ void GroupMembersWidget::updateOnlineCount() {
}
if (_onlineCount != newOnlineCount) {
_onlineCount = newOnlineCount;
onlineCountUpdated(_onlineCount);
}
}
@ -432,7 +429,7 @@ auto GroupMembersWidget::computeMember(not_null<UserData*> user)
return it->second;
}
void GroupMembersWidget::onUpdateOnlineDisplay() {
void GroupMembersWidget::updateOnlineDisplay() {
if (_sortByOnline) {
_now = base::unixtime::now();

View File

@ -7,10 +7,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/timer.h"
#include "profile/profile_block_peer_list.h"
#include <QtCore/QTimer>
namespace Ui {
class FlatLabel;
} // namespace Ui
@ -22,7 +21,6 @@ struct PeerUpdate;
namespace Profile {
class GroupMembersWidget : public PeerListWidget {
Q_OBJECT
public:
GroupMembersWidget(
@ -36,13 +34,9 @@ public:
~GroupMembersWidget();
Q_SIGNALS:
void onlineCountUpdated(int onlineCount);
private Q_SLOTS:
void onUpdateOnlineDisplay();
private:
void updateOnlineDisplay();
// Observed notifications.
void notifyPeerUpdated(const Data::PeerUpdate &update);
@ -85,7 +79,7 @@ private:
int _onlineCount = 0;
TimeId _updateOnlineAt = 0;
QTimer _updateOnlineTimer;
base::Timer _updateOnlineTimer;
};