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

View File

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