From 0a4c21a94b135dceee29f8178b7c5899810e3d85 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Thu, 14 Jun 2018 09:25:33 +0200 Subject: [PATCH 1/2] Version bump --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a6b337..36a8378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include(ECMSetupVersion) set(SNORE_VERSION_MAJOR 0) set(SNORE_VERSION_MINOR 7) -set(SNORE_VERSION_PATCH 0) +set(SNORE_VERSION_PATCH 1) set(SNORE_SUFFIX "-qt5") set(SNORE_CamelCase_SUFFIX "Qt5") From 27de669f28d1a189f23017c7b910428b6386a2da Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Thu, 14 Jun 2018 09:25:56 +0200 Subject: [PATCH 2/2] Remove NMA support Remove support for NotifyMyAndroid (NMA) as they are shutting down May 24, 2018 in response to GDPR Based on https://github.com/KDE/snorenotify/pull/21 --- src/plugins/secondary_backends/CMakeLists.txt | 1 - .../secondary_backends/nma/CMakeLists.txt | 1 - src/plugins/secondary_backends/nma/nma.cpp | 65 ------------------- src/plugins/secondary_backends/nma/nma.h | 45 ------------- .../secondary_backends/nma/nmasettings.cpp | 45 ------------- .../secondary_backends/nma/nmasettings.h | 43 ------------ 6 files changed, 200 deletions(-) delete mode 100644 src/plugins/secondary_backends/nma/CMakeLists.txt delete mode 100644 src/plugins/secondary_backends/nma/nma.cpp delete mode 100644 src/plugins/secondary_backends/nma/nma.h delete mode 100644 src/plugins/secondary_backends/nma/nmasettings.cpp delete mode 100644 src/plugins/secondary_backends/nma/nmasettings.h diff --git a/src/plugins/secondary_backends/CMakeLists.txt b/src/plugins/secondary_backends/CMakeLists.txt index 332a366..6ea9495 100644 --- a/src/plugins/secondary_backends/CMakeLists.txt +++ b/src/plugins/secondary_backends/CMakeLists.txt @@ -1,4 +1,3 @@ ecm_optional_add_subdirectory(toasty) -ecm_optional_add_subdirectory(nma) ecm_optional_add_subdirectory(sound) ecm_optional_add_subdirectory(pushover_backend) diff --git a/src/plugins/secondary_backends/nma/CMakeLists.txt b/src/plugins/secondary_backends/nma/CMakeLists.txt deleted file mode 100644 index fdbd961..0000000 --- a/src/plugins/secondary_backends/nma/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_snore_plugin(NMA SOURCES nma.cpp SETTINGS_SOURCES nmasettings.cpp TYPE SecondaryBackend) diff --git a/src/plugins/secondary_backends/nma/nma.cpp b/src/plugins/secondary_backends/nma/nma.cpp deleted file mode 100644 index eab81af..0000000 --- a/src/plugins/secondary_backends/nma/nma.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - SnoreNotify is a Notification Framework based on Qt - Copyright (C) 2015 Hannah von Reth - - SnoreNotify is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SnoreNotify is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SnoreNotify. If not, see . -*/ -#include "nma.h" - -#include "libsnore/utils.h" - -#include -#include - -using namespace Snore; - -void NotifyMyAndroid::slotNotify(Notification notification) -{ - QString key = settingsValue(QStringLiteral("ApiKey")).toString(); - if (key.isEmpty()) { - return; - } - - QNetworkRequest request(QUrl::fromEncoded("https://www.notifymyandroid.com/publicapi/notify")); - request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(QLatin1String("application/x-www-form-urlencoded"))); - - QString data = QLatin1String("apikey=") + key - + QLatin1String("&application=") + notification.application().name() - + QLatin1String("&event=") + notification.title() - + QLatin1String("&priority=") + QString::number(notification.priority()) - + QLatin1String("&description="); - - if (notification.constHints().value("supports-markup").toBool()) { - data += notification.text(Utils::Href | Utils::Bold | Utils::Break | - Utils::Underline | Utils::Font | Utils::Italic) - + QLatin1String("&content-type=text/html"); - } else { - data += notification.text(); - } - - QNetworkReply *reply = m_manager.post(request, data.toUtf8().constData()); - connect(reply, &QNetworkReply::finished, [reply]() { - qCDebug(SNORE) << reply->error(); - qCDebug(SNORE) << reply->readAll(); - reply->close(); - reply->deleteLater(); - }); - -} - -void NotifyMyAndroid::setDefaultSettings() -{ - setDefaultSettingsValue(QStringLiteral("ApiKey"), QString()); - SnoreSecondaryBackend::setDefaultSettings(); -} diff --git a/src/plugins/secondary_backends/nma/nma.h b/src/plugins/secondary_backends/nma/nma.h deleted file mode 100644 index 4d60a18..0000000 --- a/src/plugins/secondary_backends/nma/nma.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SnoreNotify is a Notification Framework based on Qt - Copyright (C) 2015 Hannah von Reth - - SnoreNotify is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SnoreNotify is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SnoreNotify. If not, see . -*/ -#ifndef NMA_H -#define NMA_H - -#include "libsnore/plugins/snoresecondarybackend.h" - -#include - -class NotifyMyAndroid : public Snore::SnoreSecondaryBackend -{ - Q_OBJECT - Q_INTERFACES(Snore::SnoreSecondaryBackend) - Q_PLUGIN_METADATA(IID "org.Snore.SecondaryNotificationBackend/1.0" FILE "snore_plugin.json") -public: - NotifyMyAndroid() = default; - ~NotifyMyAndroid() = default; - -protected: - void setDefaultSettings() override; - -public Q_SLOTS: - void slotNotify(Snore::Notification notification) override; - -private: - QNetworkAccessManager m_manager; - -}; - -#endif // NMA_H diff --git a/src/plugins/secondary_backends/nma/nmasettings.cpp b/src/plugins/secondary_backends/nma/nmasettings.cpp deleted file mode 100644 index b8fbd07..0000000 --- a/src/plugins/secondary_backends/nma/nmasettings.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - SnoreNotify is a Notification Framework based on Qt - Copyright (C) 2015 Hannah von Reth - - SnoreNotify is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SnoreNotify is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SnoreNotify. If not, see . -*/ -#include "nmasettings.h" - -#include "libsnore/plugins/plugins.h" - -#include -#include - -NotifyMyAndroidSettings::NotifyMyAndroidSettings(Snore::SnorePlugin *plugin, QWidget *parent) : - Snore::PluginSettingsWidget(plugin, parent), - m_lineEdit(new QLineEdit) -{ - addRow(tr("Api Key:"), m_lineEdit, tr("The api key which can be found in your account page at Notifymyandroid.com.")); - addRow(QString(), new QLabel(tr("If you don't have an account yet please register at Notifymyandroid.com."), this)); -} - -NotifyMyAndroidSettings::~NotifyMyAndroidSettings() -{ -} - -void NotifyMyAndroidSettings::load() -{ - m_lineEdit->setText(settingsValue(QStringLiteral("ApiKey")).toString()); -} - -void NotifyMyAndroidSettings::save() -{ - setSettingsValue(QStringLiteral("ApiKey"), m_lineEdit->text()); -} diff --git a/src/plugins/secondary_backends/nma/nmasettings.h b/src/plugins/secondary_backends/nma/nmasettings.h deleted file mode 100644 index 9adc92f..0000000 --- a/src/plugins/secondary_backends/nma/nmasettings.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - SnoreNotify is a Notification Framework based on Qt - Copyright (C) 2015 Hannah von Reth - - SnoreNotify is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SnoreNotify is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with SnoreNotify. If not, see . -*/ -#ifndef NOTIFYMYANDROID_H -#define NOTIFYMYANDROID_H - -#include "libsnore/plugins/settingsplugin.h" -#include "libsnore/settings/pluginsettingswidget.h" - -class QLineEdit; - -class NotifyMyAndroidSettings : public Snore::PluginSettingsWidget -{ - Q_OBJECT -public: - explicit NotifyMyAndroidSettings(Snore::SnorePlugin *plugin, QWidget *parent = 0); - ~NotifyMyAndroidSettings(); - - void load() override; - void save() override; - -private: - QLineEdit *m_lineEdit; - -}; - -SNORE_DECLARE_SETTINGS_PLUGIN(NotifyMyAndroidSettings) - -#endif // NOTIFYMYANDROID_HH