From e3003fc9bed4688cd6a197fc0e77acc448477347 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Fri, 1 Aug 2014 14:28:16 +0200 Subject: [PATCH] updated gntp-send --- src/plugins/backends/growl/growlbackend.cpp | 29 +++++++-------------- src/plugins/backends/growl/growlbackend.h | 2 +- thirdparty/gntp-send | 2 +- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/plugins/backends/growl/growlbackend.cpp b/src/plugins/backends/growl/growlbackend.cpp index 9e1dff7..2101864 100644 --- a/src/plugins/backends/growl/growlbackend.cpp +++ b/src/plugins/backends/growl/growlbackend.cpp @@ -23,8 +23,6 @@ #include "core/snore_p.h" - - #include #include @@ -38,7 +36,7 @@ GrowlBackend::GrowlBackend(): SnoreBackend("Growl",false,false), m_id(0) { - + s_instance = this; } GrowlBackend::~GrowlBackend() @@ -47,29 +45,22 @@ GrowlBackend::~GrowlBackend() bool GrowlBackend::initialize(SnoreCore *snore) { - - QTcpSocket qsocket; - qsocket.connectToHost("localhost", 23053); - if(qsocket.waitForConnected(100)) + if(Growl::init((GROWL_CALLBACK)&GrowlBackend::gntpCallback) && Growl::isRunning(GROWL_TCP)) { - qsocket.write(QString("GNTP/1.0\r\n").toUtf8()); - if(qsocket.waitForReadyRead(100)) - { - snoreDebug( SNORE_DEBUG ) << QString::fromUtf8(qsocket.readAll()); - s_instance = this; - Growl::setCallback((GROWL_CALLBACK)&GrowlBackend::gntpCallback); - return SnoreBackend::initialize(snore); - } + return SnoreBackend::initialize(snore); } snoreDebug( SNORE_DEBUG ) << "Growl is not running"; return false; - } bool GrowlBackend::deinitialize() { - s_instance = NULL; - return SnoreBackend::deinitialize(); + if(!Growl::shutdown()) + { + return false; + } + s_instance = NULL; + return SnoreBackend::deinitialize(); } void GrowlBackend::slotRegisterApplication(const Application &application) @@ -104,7 +95,7 @@ void GrowlBackend::slotNotify(Notification notification) QString alert = notification.alert().name(); snoreDebug( SNORE_DEBUG ) << "Notify Growl:" < +#include "growl.hpp" #include class GrowlBackend:public Snore::SnoreBackend diff --git a/thirdparty/gntp-send b/thirdparty/gntp-send index d37b3d5..20a62e3 160000 --- a/thirdparty/gntp-send +++ b/thirdparty/gntp-send @@ -1 +1 @@ -Subproject commit d37b3d53b97dee6724e185fc3b413e6b0f1d64ec +Subproject commit 20a62e3dabd121a8ecd73cabad446c13357d8b93