Commit a82ec714 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-12-01 Daniel Bates <dbates@webkit.org>

        Reviewed by Kenneth Rohde Christiansen.

        https://bugs.webkit.org/show_bug.cgi?id=31898

        Makes QtLauncher default to the http scheme for URLs.

        * QtLauncher/main.cpp:
        (MainWindow::MainWindow):
        (MainWindow::changeLocation):
        (main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a15fb1ea
2009-12-01 Daniel Bates <dbates@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
https://bugs.webkit.org/show_bug.cgi?id=31898
Makes QtLauncher default to the http scheme for URLs.
* QtLauncher/main.cpp:
(MainWindow::MainWindow):
(MainWindow::changeLocation):
(main):
2009-11-30 Abhinav Mithal <abhinav.mithal@nokia.com>
 
Reviewed by Simon Hausmann.
......
......@@ -187,10 +187,11 @@ public:
url = fi.absoluteFilePath();
QUrl qurl = urlFromUserInput(url);
if (qurl.scheme().isEmpty())
qurl = QUrl("http://" + url + "/");
if (qurl.isValid()) {
urlEdit->setText(qurl.toEncoded());
view->load(qurl);
}
// the zoom values are chosen to be like in Mozilla Firefox 3
......@@ -212,11 +213,13 @@ protected slots:
void changeLocation() {
QString string = urlEdit->text();
QUrl url = urlFromUserInput(string);
if (!url.isValid())
if (url.scheme().isEmpty())
url = QUrl("http://" + string + "/");
urlEdit->setText(url.toEncoded());
view->load(url);
view->setFocus(Qt::OtherFocusReason);
if (url.isValid()) {
urlEdit->setText(url.toEncoded());
view->load(url);
view->setFocus(Qt::OtherFocusReason);
}
}
void loadFinished() {
......@@ -562,7 +565,7 @@ int launcherMain(const QApplication& app)
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QString url = QString("%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
QString url = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
QWebSettings::setMaximumPagesInCache(4);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment