void MovieMaze::loadMovieTrailers(QString id) { m_trailerSites.clear(); m_currentTrailers.clear(); if (m_loadReply) m_loadReply->abort(); m_loadReply = m_qnam->get(QNetworkRequest(QUrl("http://www.moviemaze.de/media/trailer/" + id))); connect(m_loadReply, SIGNAL(finished()), this, SLOT(onLoadFinished())); }
/** * @brief Starts network requests to download infos from TheTvDb * @param id TheTvDb show ID * @param show Tv show object * @see TheTvDb::onLoadFinished */ void TheTvDb::loadTvShowData(QString id, TvShow *show, TvShowUpdateType updateType, QList<int> infosToLoad) { Q_UNUSED(infosToLoad) show->setTvdbId(id); QString mirror = m_xmlMirrors.at(qrand()%m_xmlMirrors.count()); QUrl url(QString("%1/api/%2/series/%3/all/%4.xml").arg(mirror).arg(m_apiKey).arg(id).arg(m_language)); show->setEpisodeGuideUrl(QString("%1/api/%2/series/%3/all/%4.zip").arg(mirror).arg(m_apiKey).arg(id).arg(m_language)); QNetworkReply *reply = qnam()->get(QNetworkRequest(url)); reply->setProperty("storage", Storage::toVariant(reply, show)); reply->setProperty("updateType", updateType); reply->setProperty("infosToLoad", Storage::toVariant(reply, infosToLoad)); connect(reply, SIGNAL(finished()), this, SLOT(onLoadFinished())); }
void IMDB::loadData(QMap<ScraperInterface*, QString> ids, Movie *movie, QList<int> infos) { movie->clear(infos); movie->setId(ids.values().first()); QUrl url(QString("http://mymovieapi.com/?id=%1&type=json&plot=full&episode=0&lang=en-US").arg(ids.values().first())); QNetworkRequest request(url); request.setRawHeader("Accept", "application/json"); QNetworkReply *reply = qnam()->get(QNetworkRequest(request)); reply->setProperty("storage", Storage::toVariant(reply, movie)); reply->setProperty("infosToLoad", Storage::toVariant(reply, infos)); connect(reply, SIGNAL(finished()), this, SLOT(onLoadFinished())); }
void IMDB::loadData(QMap<ScraperInterface*, QString> ids, Movie *movie, QList<int> infos) { movie->clear(infos); movie->setId(ids.values().first()); QUrl url = QUrl(QString("http://www.imdb.com/title/%1/").arg(ids.values().first()).toUtf8()); QNetworkRequest request = QNetworkRequest(url); request.setRawHeader("Accept-Language", "en;q=0.8"); QNetworkReply *reply = qnam()->get(request); reply->setProperty("storage", Storage::toVariant(reply, movie)); reply->setProperty("infosToLoad", Storage::toVariant(reply, infos)); connect(reply, SIGNAL(finished()), this, SLOT(onLoadFinished())); }
void NewLoader::doLoad(int pos) { time = clock(); setLoadTarget(pos); if(!cache->isLoaded(pos)) { //worker->setTarget(pos, dm->filePathAt(pos)); //qDebug() << "DO_LOAD: start timer for " << pos; preloadTimer->stop(); loadTimer->start(loadTimer->isActive() ? 20 : 0); } else { //qDebug() << "found" << pos << ", skipping load."; emit onLoadFinished(pos); } }
void IqAmeMainWindow::openFolder() { QString folder = QFileDialog::getExistingDirectory(this, tr("Open folder")); if (!folder.isEmpty()) { qDebug() << tr("START LOAD MAP DATA..."); m_loadTimer.restart(); QApplication::setOverrideCursor(Qt::WaitCursor); showLogs(); IqAmeApplication::aeroMapModel()->startLoadData(); QFutureWatcher <bool> *watcher = new QFutureWatcher<bool>(this); connect(watcher, SIGNAL(finished()), this, SLOT(onLoadFinished())); connect(watcher, SIGNAL(finished()), watcher, SLOT(deleteLater())); QString* nullResult = Q_NULLPTR; QFuture <bool> future = QtConcurrent::run(IqAmeApplication::aeroMapModel(), &IqAmeMapModel::loadFromFolder, folder, nullResult); watcher->setFuture(future); } }
Application::Application() : moteDataHolder(*this), window(NULL, *this), sdataWidget(NULL, *this) , dataRecorder(*this) , connectWidget(NULL, *this) { window.resize(800,400); window.show(); //sdataWidget.show(); sdataWidget.initLeft(false); connect(&moteDataHolder, SIGNAL(loadFinished()), &window, SLOT(onLoadFinished())); connect(&moteDataHolder, SIGNAL(sampleAdded(int)), &window, SLOT(onOnlineSampleAdded(int))); connect(&serialListener, SIGNAL(receiveMessage(ActiveMessage)), &moteDataHolder, SLOT(createSampleFromOnline(ActiveMessage)), Qt::DirectConnection); }
void SeafileModel::init() { QVariant token ( configValue("token:blowfish") ); QVariant baseUrl ( configValue("address") ); if(!baseUrl.type() != QVariant::String){ qWarning() << "INVALID URL" << baseUrl; emit error(QString("Seafile: invalid address of type ") + token.typeName()); } if(!token.type() != QVariant::String){ qWarning() << "INVALID TOKEN" << token; emit error(QString("Seafile: invalid token of type ") + token.typeName()); } this->m_server = new SeafileServer(baseUrl.toByteArray(), token.toByteArray()); this->m_server->ping(true); connect(this->m_server, SIGNAL(loadingDone()), this , SLOT(onLoadFinished()) ); connect( this->m_server, SIGNAL(file(QSharedPointer<SeafileFile>)), this , SLOT (onFile(QSharedPointer<SeafileFile>)) ); }
void MovieMaze::onLoadFinished() { if (m_loadReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 302 || m_loadReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 301) { qDebug() << "Got redirect" << m_loadReply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); QString url = m_loadReply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString(); if (!url.startsWith("http://")) url.prepend("http://www.moviemaze.de"); m_loadReply->deleteLater(); m_loadReply = m_qnam->get(QNetworkRequest(url)); connect(m_loadReply, SIGNAL(finished()), this, SLOT(onLoadFinished())); return; } if (m_loadReply->error() == QNetworkReply::NoError) { QString msg = QString::fromUtf8(m_loadReply->readAll()); m_currentTrailers.append(parseTrailers(msg)); int pos=0; QRegExp rx("<meta itemprop=\"url\" content=\"([^\"]*)\">[^<]*<meta itemprop=\"name\" content=\"([^\"]*)\">"); rx.setMinimal(true); while ((pos = rx.indexIn(msg, pos)) != -1) { if (rx.cap(2).contains("Trailer")) m_trailerSites.append(rx.cap(1)); pos += rx.matchedLength(); } } m_loadReply->deleteLater(); if (m_trailerSites.count() > 0) { m_loadReply = m_qnam->get(QNetworkRequest(m_trailerSites.at(0))); connect(m_loadReply, SIGNAL(finished()), this, SLOT(onSubLoadFinished())); } else { loadPreviewImages(); } }