nextcloud-desktop/src/gui/tray/NotificationCache.h
Felix Weilbach b736355985 Add notification cache
The notification cache helps to not display duplicate desktop
notifications to the user.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
2021-04-13 14:58:50 +00:00

28 lines
409 B
C++

#pragma once
#include <QSet>
namespace OCC {
class NotificationCache
{
public:
struct Notification
{
QString title;
QString message;
};
bool contains(const Notification &notification) const;
void insert(const Notification &notification);
void clear();
private:
uint calculateKey(const Notification &notification) const;
QSet<uint> _notifications;
};
}