1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef REQUESTQUEUE_H
- #define REQUESTQUEUE_H
- #include <QObject>
- #include <QQueue>
- #include <QNetworkSession>
- class QNetworkAccessManager;
- class QNetworkReply;
- class AdInterface;
- class QNetworkSession;
- class QNetworkConfigurationManager;
- class RequestQueue : public QObject
- {
- Q_OBJECT
- public:
- explicit RequestQueue(AdInterface *parent = 0);
- ~RequestQueue();
- void setUserAgent(const QByteArray &ua) { m_userAgent = ua; }
- bool isOnline() const;
- signals:
- public slots:
- void addToQueue(QObject *object);
- private:
- private slots:
- void handleRequests();
- void adRequestFinished(QNetworkReply *req);
- void netSessionStateChanged(QNetworkSession::State state = QNetworkSession::Connected);
- signals:
- void requestReady();
- private:
- QQueue<QObject*> m_adItemQueue;
- QNetworkAccessManager *m_nam;
- QByteArray m_userAgent;
- bool m_requestRunning;
- QNetworkConfigurationManager *m_confman;
- QNetworkSession *m_nsession;
- bool m_onlineCheck;
- bool m_networkError;
- };
- #endif
|