X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fengine%2FQBittorrentSession.cpp;fp=src%2Fengine%2FQBittorrentSession.cpp;h=7d88e2620aff0edb2e8adf32fcf405e75957b327;hp=57054c39317ff0a81a363c7101ca4d42ed5bdc4b;hb=f576091800144d69317250a69d40c711505a4f34;hpb=6c1ad29679ad40d0aca951c3af76a97ed284e802 diff --git a/src/engine/QBittorrentSession.cpp b/src/engine/QBittorrentSession.cpp index 57054c3..7d88e26 100644 --- a/src/engine/QBittorrentSession.cpp +++ b/src/engine/QBittorrentSession.cpp @@ -41,7 +41,7 @@ QBittorrentSession::~QBittorrentSession() } -QTorrentHandle +QTorrentHandle QBittorrentSession::addTorrent(AddTorrentParams const& params) { // Delegate to Libtorrent and return QTorrentHandle. @@ -58,14 +58,17 @@ void QBittorrentSession::removeTorrent(QTorrentHandle const& handle) // ========================== SLOTS ============================== +/// @TODO This function is called when AlertWaiterThread emits alert() +/// If connection is direct, as it is now, we need to use QMutex here (if necessary?) void QBittorrentSession::on_alert(Alert const *al) //NOTE: al parameter not necessarily needed here, as we pop_alert() now! { - //qDebug() << "QBittorrentSession:on_alert(" << al << ")"; -// if (al) -// qDebug() << "on_alert():" << QString::fromStdString(al->message()); - +#ifdef QTRAPIDS_DEBUG + if (al) + qDebug() << "on_alert():" << QString::fromStdString(al->message()); +#endif + std::auto_ptr alertPtr = btSession_.pop_alert(); emit alert(alertPtr); }