dont connect primary notification backend with signal notify
This commit is contained in:
parent
b4bf83a880
commit
a6adddebbe
|
@ -89,10 +89,14 @@ void SnoreServer::publicatePlugin(SnorePlugin *plugin){
|
|||
_primaryNotificationBackends.insert(pluginName,nb);
|
||||
if(_notificationBackend==NULL){
|
||||
_notificationBackend=nb;
|
||||
}else{
|
||||
connect(this,SIGNAL(notify(QSharedPointer<Notification>)),nb,SLOT(notify(QSharedPointer<Notification>)));
|
||||
}
|
||||
}else{
|
||||
connect(this,SIGNAL(notify(QSharedPointer<Notification>)),nb,SLOT(notify(QSharedPointer<Notification>)));
|
||||
}
|
||||
_notyfier.insert(pluginName,nb);
|
||||
connect(this,SIGNAL(notify(QSharedPointer<Notification>)),nb,SLOT(notify(QSharedPointer<Notification>)));
|
||||
|
||||
connect(this,SIGNAL(closeNotify(QSharedPointer<Notification>)),nb,SLOT(closeNotification(QSharedPointer<Notification>)));
|
||||
connect(this,SIGNAL(applicationInitialized(Application*)),nb,SLOT(registerApplication(Application*)));
|
||||
connect(this,SIGNAL(applicationRemoved(Application*)),nb,SLOT(unregisterApplication(Application*)));
|
||||
|
@ -104,7 +108,6 @@ void SnoreServer::publicatePlugin(SnorePlugin *plugin){
|
|||
|
||||
int SnoreServer::broadcastNotification(QSharedPointer<Notification> notification){
|
||||
emit notify(notification);
|
||||
qDebug()<<"Broadcasting notification:"<<notification->toString();
|
||||
if(_notificationBackend!=NULL){
|
||||
notification->_id=_notificationBackend->notify(notification);
|
||||
std::cout<<"Notification ID: "<<QString::number(notification->_id).toLatin1().data()<<std::endl;
|
||||
|
@ -151,6 +154,8 @@ const QHash<QString,Notification_Backend*> &SnoreServer::primaryNotificationBack
|
|||
}
|
||||
|
||||
void SnoreServer::setNotificationBackend(Notification_Backend *backend){
|
||||
connect(this,SIGNAL(notify(QSharedPointer<Notification>)),_notificationBackend,SLOT(notify(QSharedPointer<Notification>)));
|
||||
disconnect(backend,SLOT(notify(QSharedPointer<Notification>)));
|
||||
_notificationBackend=backend;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,16 +45,13 @@ void Growl_Backend::registerApplication(Application *application){
|
|||
char **n = new char*[alertCount];
|
||||
for (int i = 0 ; i < alertCount; ++i){
|
||||
QString name = aList.at(i)->name();
|
||||
qDebug()<<name;
|
||||
n[i] = new char[name.length()+1];
|
||||
strcpy(n[i],name.toLatin1().data());
|
||||
qDebug()<<"Add alert to growl"<<n[i];
|
||||
}
|
||||
|
||||
_applications.insert(application->name(),new Growl(GROWL_TCP,NULL,application->name().toLatin1().data(),(const char**)n,application->alerts().count()));
|
||||
|
||||
for (int i = 0 ; i < alertCount; ++i){
|
||||
qDebug()<<"Delete"<<n[i];
|
||||
delete [] n[i];
|
||||
}
|
||||
delete [] n;
|
||||
|
|
|
@ -51,11 +51,9 @@ void Snarl_Backend::registerApplication(Application *application){
|
|||
|
||||
wchar_t *appName = toWchar(application->name());
|
||||
snarlInterface->RegisterApp(appName,L"",L"");
|
||||
wprintf(L"Registering %s with Snarl.",appName);
|
||||
|
||||
foreach(Alert *alert,application->alerts()){
|
||||
wchar_t *alertName = toWchar(alert->name());
|
||||
wprintf(L"Registering %s als snarl alert classSnarl.",alertName);
|
||||
snarlInterface->RegisterAlert(appName,alertName);
|
||||
delete [] alertName;
|
||||
}
|
||||
|
|
|
@ -50,8 +50,6 @@ Parser::Parser(SnarlNetworkFrontend *snarl):snarl(snarl)
|
|||
|
||||
|
||||
SnarlNotification Parser::parse(QString &msg,QTcpSocket* client){
|
||||
qDebug()<<msg;
|
||||
|
||||
SnarlNotification sNotification;
|
||||
sNotification.httpClient=false;
|
||||
sNotification.vailid=true;
|
||||
|
|
|
@ -48,7 +48,6 @@ int WebPoster::notify(QSharedPointer<Notification>notification){
|
|||
QEventLoop loop;
|
||||
connect(reply, SIGNAL(readyRead()), &loop, SLOT(quit()));
|
||||
loop.exec();
|
||||
std::cout<<"WbPoster"<<reply->readAll().data()<<std::endl;
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue