Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>2021-11-16 18:11:44 +0300
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>2021-11-16 18:11:44 +0300
commitc59f88ca825796bef7e8788176e98b99f6582c44 (patch)
treef98f8b30b402876c9c1f361148c335586348285e /src/gui
parent3edfcff1a073a9bb5ee1dcc92f91465540bcfff3 (diff)
avoid adding icon data in a cache we never use
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/tray/notificationhandler.cpp12
-rw-r--r--src/gui/tray/notificationhandler.h2
2 files changed, 0 insertions, 14 deletions
diff --git a/src/gui/tray/notificationhandler.cpp b/src/gui/tray/notificationhandler.cpp
index b21f7e8e1..ccac7b1de 100644
--- a/src/gui/tray/notificationhandler.cpp
+++ b/src/gui/tray/notificationhandler.cpp
@@ -17,7 +17,6 @@ const QString notificationsPath = QLatin1String("ocs/v2.php/apps/notifications/a
const char propertyAccountStateC[] = "oc_account_state";
const int successStatusCode = 200;
const int notModifiedStatusCode = 304;
-QMap<int, QByteArray> ServerNotificationHandler::iconCache;
ServerNotificationHandler::ServerNotificationHandler(AccountState *accountState, QObject *parent)
: QObject(parent)
@@ -72,11 +71,6 @@ void ServerNotificationHandler::slotAllowDesktopNotificationsChanged(bool isAllo
}
}
-void ServerNotificationHandler::slotIconDownloaded(QByteArray iconData)
-{
- iconCache.insert(sender()->property("activityId").toInt(),iconData);
-}
-
void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &json, int statusCode)
{
if (statusCode != successStatusCode && statusCode != notModifiedStatusCode) {
@@ -112,12 +106,6 @@ void ServerNotificationHandler::slotNotificationsReceived(const QJsonDocument &j
a._message = json.value("message").toString();
a._icon = json.value("icon").toString();
- if (!a._icon.isEmpty()) {
- auto *iconJob = new IconJob(_accountState->account(), QUrl(a._icon));
- iconJob->setProperty("activityId", a._id);
- connect(iconJob, &IconJob::jobFinished, this, &ServerNotificationHandler::slotIconDownloaded);
- }
-
QUrl link(json.value("link").toString());
if (!link.isEmpty()) {
if (link.host().isEmpty()) {
diff --git a/src/gui/tray/notificationhandler.h b/src/gui/tray/notificationhandler.h
index 5bd824f5c..3f2622167 100644
--- a/src/gui/tray/notificationhandler.h
+++ b/src/gui/tray/notificationhandler.h
@@ -14,7 +14,6 @@ class ServerNotificationHandler : public QObject
Q_OBJECT
public:
explicit ServerNotificationHandler(AccountState *accountState, QObject *parent = nullptr);
- static QMap<int, QByteArray> iconCache;
signals:
void newNotificationList(ActivityList);
@@ -25,7 +24,6 @@ public slots:
private slots:
void slotNotificationsReceived(const QJsonDocument &json, int statusCode);
void slotEtagResponseHeaderReceived(const QByteArray &value, int statusCode);
- void slotIconDownloaded(QByteArray iconData);
void slotAllowDesktopNotificationsChanged(bool isAllowed);
private: