Commit 8c83d32d authored by Wescoeur's avatar Wescoeur

feat(MessagesCountNotifier): limit counter to 99

parent de2fcd99
......@@ -22,15 +22,15 @@
#include "../core/CoreManager.hpp"
#include "MessagesCountNotifier.hpp"
#if defined(Q_OS_LINUX)
// TODO.
#elif defined(Q_OS_MACOS)
#include "MessagesCountNotifierMacOS.h"
#elif defined(Q_OS_WIN)
// TODO.
#endif
#endif // if defined(Q_OS_LINUX)
#include "MessagesCountNotifier.hpp"
using namespace std;
......@@ -62,14 +62,15 @@ void MessagesCountNotifier::updateUnreadMessagesCount () {
void MessagesCountNotifier::notifyUnreadMessagesCount () {
qInfo() << QStringLiteral("Notify unread messages count: %1.").arg(mUnreadMessagesCount);
int count = mUnreadMessagesCount > 99 ? 99 : mUnreadMessagesCount;
#if defined(Q_OS_LINUX)
// TODO.
#elif defined(Q_OS_MACOS)
::notifyUnreadMessagesCountMacOS(mUnreadMessagesCount);
::notifyUnreadMessagesCountMacOS(count);
#elif defined(Q_OS_WIN)
// TODO.
#endif
#endif // if defined(Q_OS_LINUX)
}
// -----------------------------------------------------------------------------
......
......@@ -27,7 +27,7 @@
// =============================================================================
namespace linphone {
class ChatMessage;
class ChatMessage;
}
class ChatModel;
......
......@@ -22,5 +22,4 @@
// =============================================================================
extern "C" void notifyUnreadMessagesCountMacOS(int count);
extern "C" void notifyUnreadMessagesCountMacOS (int count);
......@@ -28,4 +28,3 @@ void notifyUnreadMessagesCountMacOS(int count) {
NSString *badgeStr = (count > 0) ? [NSString stringWithFormat:@"%d", count] : @"";
[[NSApp dockTile] setBadgeLabel:badgeStr];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment