use cool new connects
This commit is contained in:
parent
65931bdf9d
commit
b331644379
|
@ -17,7 +17,6 @@ Toasty::~Toasty()
|
|||
|
||||
void Toasty::slotNotify(Notification notification)
|
||||
{
|
||||
if (!m_key.isEmpty()) {
|
||||
QNetworkRequest request(QString("http://api.supertoasty.com/notify/%1").arg(m_key));
|
||||
QHttpMultiPart *mp = new QHttpMultiPart(QHttpMultiPart::FormDataType);
|
||||
QHttpPart title;
|
||||
|
@ -53,17 +52,12 @@ void Toasty::slotNotify(Notification notification)
|
|||
mp->setParent(reply);
|
||||
file->setParent(reply);
|
||||
|
||||
connect(reply, SIGNAL(finished()), this, SLOT(slotRequestFinished()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Toasty::slotRequestFinished()
|
||||
{
|
||||
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
|
||||
connect(reply, &QNetworkReply::finished, this, [reply](){
|
||||
snoreDebug(SNORE_DEBUG) << reply->readAll();
|
||||
reply->close();
|
||||
reply->deleteLater();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bool Toasty::initialize(SnoreCore *snore)
|
||||
|
|
|
@ -19,9 +19,6 @@ public:
|
|||
public slots:
|
||||
virtual void slotNotify(Snore::Notification notification) override;
|
||||
|
||||
private slots:
|
||||
void slotRequestFinished();
|
||||
|
||||
private:
|
||||
QString m_key;
|
||||
QNetworkAccessManager m_manager;
|
||||
|
|
Loading…
Reference in New Issue