alertWaiter_(NULL)
{
alertWaiter_ = new AlertWaiterThread(&btSession_, this);
+ alertWaiter_->allAlerts();
connect(alertWaiter_, SIGNAL(alert(TorrentAlert const*)), this, SLOT(on_alert(TorrentAlert const*)));
alertWaiter_->start();
}
{
// Delegate to Libtorrent and return QTorrentHandle.
QTorrentHandle handle(btSession_.add_torrent(params));
+ qDebug() << "Is valid: " << handle.isValid();
return handle;
}
// ========================== SLOTS ==============================
-void QBittorrentSession::on_alert(TorrentAlert const *al)
+void QBittorrentSession::on_alert(TorrentAlert const *al)
+ //NOTE: al parameter not necessarily needed here, as we pop_alert() now!
{
+
qDebug() << "QBittorrentSession:on_alert(" << al << ")";
- emit alert(al);
+// if (al)
+// qDebug() << "on_alert():" << QString::fromStdString(al->message());
+
+
+ std::auto_ptr<TorrentAlert> alertPtr = btSession_.pop_alert();
+ emit alert(alertPtr);
}