mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-01 00:16:23 +00:00
fix(MessagesCountNotifier): avoid pure virtual call
This commit is contained in:
parent
97c57547e6
commit
28d64620f3
3 changed files with 6 additions and 6 deletions
|
|
@ -62,7 +62,10 @@ CoreManager::CoreManager (QObject *parent, const QString &configPath) :
|
|||
CoreHandlers *coreHandlers = mHandlers.get();
|
||||
|
||||
QObject::connect(coreHandlers, &CoreHandlers::coreStarted, this, [] {
|
||||
new MessagesCountNotifier(mInstance);
|
||||
{
|
||||
MessagesCountNotifier *messagesCountNotifier = new MessagesCountNotifier(mInstance);
|
||||
messagesCountNotifier->updateUnreadMessagesCount();
|
||||
}
|
||||
|
||||
mInstance->mCallsListModel = new CallsListModel(mInstance);
|
||||
mInstance->mContactsListModel = new ContactsListModel(mInstance);
|
||||
|
|
|
|||
|
|
@ -38,14 +38,10 @@ AbstractMessagesCountNotifier::AbstractMessagesCountNotifier (QObject *parent) :
|
|||
coreManager->getHandlers().get(), &CoreHandlers::messageReceived,
|
||||
this, &AbstractMessagesCountNotifier::handleMessageReceived
|
||||
);
|
||||
|
||||
updateUnreadMessagesCount();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void AbstractMessagesCountNotifier::notifyUnreadMessagesCount (int) {}
|
||||
|
||||
void AbstractMessagesCountNotifier::updateUnreadMessagesCount () {
|
||||
mUnreadMessagesCount = 0;
|
||||
for (const auto &chatRoom : CoreManager::getInstance()->getCore()->getChatRooms())
|
||||
|
|
|
|||
|
|
@ -39,11 +39,12 @@ public:
|
|||
AbstractMessagesCountNotifier (QObject *parent = Q_NULLPTR);
|
||||
virtual ~AbstractMessagesCountNotifier () = default;
|
||||
|
||||
void updateUnreadMessagesCount ();
|
||||
|
||||
protected:
|
||||
virtual void notifyUnreadMessagesCount (int n) = 0;
|
||||
|
||||
private:
|
||||
void updateUnreadMessagesCount ();
|
||||
void internalNotifyUnreadMessagesCount ();
|
||||
|
||||
void handleChatModelCreated (const std::shared_ptr<ChatModel> &chatModel);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue