better logging for the growl backend
This commit is contained in:
parent
362d5c1865
commit
7d745469ed
|
@ -64,7 +64,7 @@ bool Growl::init(SnoreCore *snore)
|
||||||
}
|
}
|
||||||
catch(const std::exception& e)
|
catch(const std::exception& e)
|
||||||
{
|
{
|
||||||
qDebug() << "Growl:" << e.what();
|
qWarning() << Q_FUNC_INFO << e.what();
|
||||||
delete m_defaultGNTP;
|
delete m_defaultGNTP;
|
||||||
m_defaultGNTP = NULL;
|
m_defaultGNTP = NULL;
|
||||||
return false;
|
return false;
|
||||||
|
@ -79,9 +79,11 @@ void Growl::slotRegisterApplication(Application *application)
|
||||||
gntp::gntp_callback callback(&Growl::gntpCallback);
|
gntp::gntp_callback callback(&Growl::gntpCallback);
|
||||||
growl->set_gntp_callback(callback);
|
growl->set_gntp_callback(callback);
|
||||||
|
|
||||||
|
// qDebug() << Q_FUNC_INFO << application->name().toUtf8().constData();
|
||||||
std::vector<std::string> alerts;
|
std::vector<std::string> alerts;
|
||||||
foreach(Alert *a,application->alerts())
|
foreach(Alert *a,application->alerts())
|
||||||
{
|
{
|
||||||
|
// qDebug() << Q_FUNC_INFO << a->name().toUtf8().constData();
|
||||||
alerts.push_back(a->name().toUtf8().constData());
|
alerts.push_back(a->name().toUtf8().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +92,7 @@ void Growl::slotRegisterApplication(Application *application)
|
||||||
growl->regist(alerts);
|
growl->regist(alerts);
|
||||||
}catch(const std::exception& e)
|
}catch(const std::exception& e)
|
||||||
{
|
{
|
||||||
qDebug() << "Growl:" << e.what();
|
qWarning() << Q_FUNC_INFO << e.what();
|
||||||
}
|
}
|
||||||
m_applications.insert(application->name(),growl);
|
m_applications.insert(application->name(),growl);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +116,7 @@ void Growl::slotNotify(Notification notification)
|
||||||
growl = m_defaultGNTP;
|
growl = m_defaultGNTP;
|
||||||
alert = "Default";
|
alert = "Default";
|
||||||
}
|
}
|
||||||
//qDebug()<<"Notify Growl:"<<notification.application()<<Notification.toPlainText(notification.title());
|
// qDebug() << "Notify Growl:" <<notification.application() << alert << Snore::toPlainText(notification.title());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
growl->notify(alert.toUtf8().constData(),notification.id(),
|
growl->notify(alert.toUtf8().constData(),notification.id(),
|
||||||
|
@ -125,13 +127,13 @@ void Growl::slotNotify(Notification notification)
|
||||||
}
|
}
|
||||||
catch(const std::exception& e)
|
catch(const std::exception& e)
|
||||||
{
|
{
|
||||||
qDebug() << "Growl:" << e.what();
|
qWarning() << Q_FUNC_INFO << e.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Growl::gntpCallback(const int &id,const std::string &reason,const std::string &data)
|
void Growl::gntpCallback(const int &id,const std::string &reason,const std::string &data)
|
||||||
{
|
{
|
||||||
qDebug() << "Growl Callback" << id << QString(reason.c_str()) << QString(data.c_str());
|
// qDebug() << Q_FUNC_INFO << id << QString(reason.c_str()) << QString(data.c_str());
|
||||||
Notification n = s_instance->snore()->getActiveNotificationByID(id);
|
Notification n = s_instance->snore()->getActiveNotificationByID(id);
|
||||||
NotificationEnums::CloseReasons::closeReasons r = NotificationEnums::CloseReasons::NONE;
|
NotificationEnums::CloseReasons::closeReasons r = NotificationEnums::CloseReasons::NONE;
|
||||||
if(reason == "TIMEDOUT")
|
if(reason == "TIMEDOUT")
|
||||||
|
|
Loading…
Reference in New Issue