Changeset 46267 in webkit


Ignore:
Timestamp:
Jul 23, 2009 7:31:10 AM (15 years ago)
Author:
Simon Hausmann
Message:

2009-07-23 Laszlo Gombos <Laszlo Gombos>

Reviewed by Simon Hausmann.

[Qt] Add simple proxy support for QtLauncher
https://bugs.webkit.org/show_bug.cgi?id=27495

Picks up proxy settings from the http_proxy environment
variable.

  • QtLauncher/QtLauncher.pro: Add QtNetwork dependency for all platforms.
  • QtLauncher/main.cpp: (MainWindow::MainWindow):
Location:
trunk/WebKit/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/ChangeLog

    r46265 r46267  
     12009-07-23  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] Add simple proxy support for QtLauncher
     6        https://bugs.webkit.org/show_bug.cgi?id=27495
     7
     8        Picks up proxy settings from the http_proxy environment
     9        variable.
     10
     11        * QtLauncher/QtLauncher.pro: Add QtNetwork dependency for all
     12        platforms.
     13        * QtLauncher/main.cpp:
     14        (MainWindow::MainWindow):
     15
    1162009-07-23  Simon Hausmann  <simon.hausmann@nokia.com>
    217
  • trunk/WebKit/qt/QtLauncher/QtLauncher.pro

    r32619 r46267  
    77include(../../../WebKit.pri)
    88
    9 macx:QT+=xml network
     9QT += network
     10macx:QT+=xml
    1011QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
  • trunk/WebKit/qt/QtLauncher/main.cpp

    r46264 r46267  
    3838#include <QtGui>
    3939#include <QDebug>
     40#include <QtNetwork/QNetworkProxy>
    4041#if QT_VERSION >= 0x040400 && !defined(QT_NO_PRINTER)
    4142#include <QPrintPreviewDialog>
     
    7071        setCentralWidget(view);
    7172
    72         view->setPage(new WebPage(view));
    73 
     73        WebPage* page = new WebPage(view);
     74        view->setPage(page);
     75       
    7476        connect(view, SIGNAL(loadFinished(bool)),
    7577                this, SLOT(loadFinished()));
     
    8183
    8284        setupUI();
     85
     86        // set the proxy to the http_proxy env variable - if present       
     87        QUrl proxyUrl = view->guessUrlFromString(qgetenv("http_proxy"));
     88        if (proxyUrl.isValid() && !proxyUrl.host().isEmpty()) {
     89            int proxyPort = (proxyUrl.port() > 0)  ? proxyUrl.port() : 8080;
     90            page->networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyPort));
     91        }
    8392
    8493        QUrl qurl = view->guessUrlFromString(url);
Note: See TracChangeset for help on using the changeset viewer.