X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fengine%2FAlertWaiterThread.h;h=7d14ef90bef263ef4d9b9fb2a1474100b4899662;hp=5ba3bf6cb86e5b9c95edcacf6984c70616440dcc;hb=f576091800144d69317250a69d40c711505a4f34;hpb=afa034e0adbbeaf337e34671efd44f5e487c17ba diff --git a/src/engine/AlertWaiterThread.h b/src/engine/AlertWaiterThread.h index 5ba3bf6..7d14ef9 100644 --- a/src/engine/AlertWaiterThread.h +++ b/src/engine/AlertWaiterThread.h @@ -21,6 +21,8 @@ #define ALERTWAITERTHREAD_H #include +#include "QBittorrentSession.h" + /** @author Lassi Väätämöinen @@ -30,17 +32,23 @@ class AlertWaiterThread : public QThread Q_OBJECT public: - AlertWaiterThread(QObject* parent = 0); + AlertWaiterThread(TorrentSession *const session, QObject *parent = 0); - ~AlertWaiterThread(); + virtual ~AlertWaiterThread(); - void run(); // Overridden from QThread + void allAlerts(bool enable = true); + + virtual void run(); // Overridden from QThread signals: - void alert(); + /// @TODO alert() uses direct connection, so th connected slot is executed by AlertWaiterThread + /// Hence, QMutex is needed in receiver slot/thread for thread-safety. + /// @NOTE Alternatively, we could use an event loop in the thread and use queued signal (is it heavier?) + void alert(Alert const *alert); private: - + TorrentSession *const btSession_; + }; #endif