Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (33 sloc) 0.857 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#include "Command.h"
#include <QObject>
#include <QStringList>

class Response;
class WebPageManager;
class QTimer;

/* Decorates a command with a timeout.
*
* If the timeout, using a QTimer is reached before
* the command is finished, the load page load will
* be stopped and failure response will be issued.
*
*/
class TimeoutCommand : public Command {
  Q_OBJECT
 
  public:
   TimeoutCommand(Command *command, WebPageManager *page, QObject *parent = 0);
  virtual void start();

  public slots:
    void commandTimeout();
    void commandFinished(Response *response);
    void pageLoadingFromCommand();
    void pendingLoadFinished(bool);

  signals:
    void finished(Response *response);

  protected:
    void startCommand();
    void startTimeout();

  private:
    WebPageManager *m_manager;
    QTimer *m_timer;
    Command *m_command;
};
 
Something went wrong with that request. Please try again.