mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 13:56:25 +00:00
feat(MessagesCountNotifier): limit counter to 99
This commit is contained in:
parent
de2fcd992d
commit
8c83d32da5
4 changed files with 8 additions and 9 deletions
|
|
@ -22,15 +22,15 @@
|
||||||
|
|
||||||
#include "../core/CoreManager.hpp"
|
#include "../core/CoreManager.hpp"
|
||||||
|
|
||||||
#include "MessagesCountNotifier.hpp"
|
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
// TODO.
|
// TODO.
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
#include "MessagesCountNotifierMacOS.h"
|
#include "MessagesCountNotifierMacOS.h"
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
// TODO.
|
// TODO.
|
||||||
#endif
|
#endif // if defined(Q_OS_LINUX)
|
||||||
|
|
||||||
|
#include "MessagesCountNotifier.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
@ -62,14 +62,15 @@ void MessagesCountNotifier::updateUnreadMessagesCount () {
|
||||||
|
|
||||||
void MessagesCountNotifier::notifyUnreadMessagesCount () {
|
void MessagesCountNotifier::notifyUnreadMessagesCount () {
|
||||||
qInfo() << QStringLiteral("Notify unread messages count: %1.").arg(mUnreadMessagesCount);
|
qInfo() << QStringLiteral("Notify unread messages count: %1.").arg(mUnreadMessagesCount);
|
||||||
|
int count = mUnreadMessagesCount > 99 ? 99 : mUnreadMessagesCount;
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
// TODO.
|
// TODO.
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
::notifyUnreadMessagesCountMacOS(mUnreadMessagesCount);
|
::notifyUnreadMessagesCountMacOS(count);
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
// TODO.
|
// TODO.
|
||||||
#endif
|
#endif // if defined(Q_OS_LINUX)
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
namespace linphone {
|
namespace linphone {
|
||||||
class ChatMessage;
|
class ChatMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChatModel;
|
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] : @"";
|
NSString *badgeStr = (count > 0) ? [NSString stringWithFormat:@"%d", count] : @"";
|
||||||
[[NSApp dockTile] setBadgeLabel:badgeStr];
|
[[NSApp dockTile] setBadgeLabel:badgeStr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue