diff --git a/src/core/plugins/snorebackend.h b/src/core/plugins/snorebackend.h index 32d071d..b67c152 100644 --- a/src/core/plugins/snorebackend.h +++ b/src/core/plugins/snorebackend.h @@ -36,8 +36,8 @@ class SNORE_EXPORT SnoreBackend : public SnorePlugin public: SnoreBackend(const QString &name, bool canCloseNotification, bool supportsRichtext, bool canUpdateNotifications = false); virtual ~SnoreBackend(); - virtual bool initialize(SnoreCore *snore); - virtual bool deinitialize(); + virtual bool initialize(SnoreCore *snore) override; + virtual bool deinitialize() override; void requestCloseNotification(Snore::Notification notification, Notification::CloseReasons reason); diff --git a/src/plugins/secondary_backends/toasty/toasty.cpp b/src/plugins/secondary_backends/toasty/toasty.cpp index 504ef6f..87efa43 100644 --- a/src/plugins/secondary_backends/toasty/toasty.cpp +++ b/src/plugins/secondary_backends/toasty/toasty.cpp @@ -1,6 +1,7 @@ #include "toasty.h" #include +#include Q_EXPORT_PLUGIN2(libsnore_secondary_backend_toasty, Toasty) @@ -11,6 +12,11 @@ Toasty::Toasty(): { } +Toasty::~Toasty() +{ + +} + void Toasty::slotNotify(Notification notification) { QString id = value("DEVICEID").toString(); @@ -33,7 +39,12 @@ void Toasty::slotNotify(Notification notification) mp->append(app); QHttpPart icon; - Icon sIcon(notification.icon().scaled(QSize(127, 127))); + + Icon sIcon = notification.icon(); + QSize iconSize = notification.icon().image().size(); + if (iconSize.height() > 128 || iconSize.width() > 128 ) { + sIcon = sIcon.scaled(QSize(128, 128)); + } icon.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(QString("form-data; name=\"image\"; filename=\"%1\"").arg(sIcon.localUrl()))); icon.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/png")); QFile *file = new QFile(sIcon.localUrl()); diff --git a/src/plugins/secondary_backends/toasty/toasty.h b/src/plugins/secondary_backends/toasty/toasty.h index 869845f..2ecfacf 100644 --- a/src/plugins/secondary_backends/toasty/toasty.h +++ b/src/plugins/secondary_backends/toasty/toasty.h @@ -12,11 +12,12 @@ class Toasty : public Snore::SnoreSecondaryBackend Q_PLUGIN_METADATA(IID "org.Snore.SecondaryNotificationBackend/1.0") public: Toasty(); - virtual bool initialize(Snore::SnoreCore *snore); - virtual bool deinitialize(); + ~Toasty(); + virtual bool initialize(Snore::SnoreCore *snore) override; + virtual bool deinitialize() override; public slots: - virtual void slotNotify(Snore::Notification notification); + virtual void slotNotify(Snore::Notification notification) override; private slots: void slotRequestFinished();