Пример #1
0
void LocationBar::urlEnter()
{
    m_locationCompleter->popup()->hide();
    m_webView->setFocus();

    emit loadUrl(createUrl());
}
Пример #2
0
void LocationBar::urlEnter()
{
    m_completer.closePopup();
    m_webView->setFocus();

    emit loadUrl(createUrl());
}
Пример #3
0
void MainWindow::processQueue( bool keepFirst /*=false*/)
{
  // remove first of the list (if has been previously downloaded)
  if ( !keepFirst )
    mDnlQueue.removeFirst();

  // if list is empty, no more image to download!
  if ( mDnlQueue.size() == 0)
  {
    unFreezeGui();
    return;
  }

  // global progress bar
  int progress = mPoints.size() - mDnlQueue.size();
  ui->globalProgressBar->setValue( progress );

  cancelCurrentDownload();

  DnlElement elem = mDnlQueue.first();

  QString url = createUrl( elem.mRow );
  mLastRequestTime = QDateTime::currentMSecsSinceEpoch();
  QNetworkRequest request = createRequest( url );
  mReply = mFileDownloader->get( request );
  connect( mReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(setDnlProgress(qint64,qint64)) );
  connect( mReply, SIGNAL(finished()), this, SLOT(newImageData()) );
  connect( mReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(newImageData()) );
  ui->dnlProgressBar->setValue(0);
  ui->dnlProgressBar->show();
}
Пример #4
0
void LocationMap::showAddress( const KABC::Address &addr )
{
    KURL url( createUrl( addr ) );
    if ( url.isEmpty() )
        return;

    kapp->invokeBrowser( url.url() );
}
Пример #5
0
void LocationBar::urlEnter()
{
    const QUrl url = createUrl();
    const QString urlString = convertUrlToText(url);

    m_completer.closePopup();
    m_webView->setFocus();

    if (urlString != text()) {
        setText(convertUrlToText(url));
    }

    emit loadUrl(url);
}
Пример #6
0
int QHttpConnection::HeadersComplete(http_parser *parser)
{
    QHttpConnection *theConnection = static_cast<QHttpConnection *>(parser->data);
    Q_ASSERT(theConnection->m_request);

    /** set method **/
    theConnection->m_request->setMethod(static_cast<QHttpRequest::HttpMethod>(parser->method));

    /** set version **/
    theConnection->m_request->setVersion(
        QString("%1.%2").arg(parser->http_major).arg(parser->http_minor));

    /** get parsed url **/
    struct http_parser_url urlInfo;
    int r = http_parser_parse_url(theConnection->m_currentUrl.constData(),
                                  theConnection->m_currentUrl.size(),
                                  parser->method == HTTP_CONNECT, &urlInfo);
    Q_ASSERT(r == 0);
    Q_UNUSED(r);

    theConnection->m_request->setUrl(createUrl(theConnection->m_currentUrl.constData(), urlInfo));

    // Insert last remaining header
    theConnection->m_currentHeaders[theConnection->m_currentHeaderField.toLower()] =
        theConnection->m_currentHeaderValue;
    theConnection->m_request->setHeaders(theConnection->m_currentHeaders);

    /** set client information **/
    theConnection->m_request->m_remoteAddress = theConnection->m_socket->peerAddress().toString();
    theConnection->m_request->m_remotePort = theConnection->m_socket->peerPort();

    QHttpResponse *response = new QHttpResponse(theConnection);
    if (parser->http_major < 1 || parser->http_minor < 1)
        response->m_keepAlive = false;

    connect(theConnection, SIGNAL(destroyed()), response, SLOT(connectionClosed()));
    connect(response, SIGNAL(done()), theConnection, SLOT(responseDone()));

    // we are good to go!
    emit theConnection->newRequest(theConnection->m_request, response);
    return 0;
}
Пример #7
0
QUrl ApplicationHelper::createUrl(const QStringList &urlParts, const QString& page)
{
    return createUrl(urlParts.join('/'), page);
}
Пример #8
0
QUrl ApplicationHelper::createUrl(const QString& url, const QString& page)
{
    return createUrl(url, page.toInt());
}
Пример #9
0
 UrlT makeUrl(const StringT& path, const ParamsT& params = ParamsT())
 {
     return createUrl(m_baseUrl, path, params);
 }