NetworkReader::NetworkReader(QNetworkReply* reply, QObject* parent) :QObject(parent) { mReply = reply; connect(mReply, SIGNAL(finished()), this, SLOT(readData())); mTimer.setSingleShot(true); connect(&mTimer, SIGNAL(timeout()), this, SLOT( networkTimeout())); mTimer.start(20000); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { createWidgets(); createLayout(); issueLinkFetcher = new LinkFetcher(NYRBUrl, scriptPathAndName("fetch_issue_links.js"), this); articleLinkFetcher = new LinkFetcher(NYRBUrl, scriptPathAndName("fetch_article_links.js"), this); createConnections(); AQP::accelerateWidget(this); issueComboBox->setFocus(); issueLinkFetcher->load(NYRBUrl); setWindowTitle(QApplication::applicationName()); QTimer::singleShot(1000 * 60, this, SLOT(networkTimeout())); }
/** * @brief TimeoutSocket::timeoutSlot */ void TimeoutSocket::timeoutSlot() { emit networkTimeout(); disconnect(mAuthTimeout, SIGNAL(timeout()), this, SLOT(timeoutSlot())); this->disconnectFromHost(); close(); }