2011-01-27 Jacob Dinu <dinu.jacob@nokia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2011 00:21:55 +0000 (00:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Jan 2011 00:21:55 +0000 (00:21 +0000)
        Reviewed by Andreas Kling.

        [Qt] QtTestBrowser: User input lost when toggling use of QGraphicsView
        https://bugs.webkit.org/show_bug.cgi?id=48440

        Preserve user input when toggling use of QGraphicsView

        * QtTestBrowser/launcherwindow.cpp:
        (LauncherWindow::initializeView):
        (LauncherWindow::loadFinished):
        * QtTestBrowser/launcherwindow.h:
        * QtTestBrowser/mainwindow.cpp:
        (MainWindow::addressUrl):
        * QtTestBrowser/mainwindow.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76860 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/QtTestBrowser/launcherwindow.cpp
Tools/QtTestBrowser/launcherwindow.h
Tools/QtTestBrowser/mainwindow.cpp
Tools/QtTestBrowser/mainwindow.h

index 93f200a39253c85a7506662c77c98e54b35330cb..52807b9caa8988b4a2edd6da46fb9863c1059fc8 100644 (file)
@@ -1,3 +1,20 @@
+2011-01-27  Jacob Dinu  <dinu.jacob@nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] QtTestBrowser: User input lost when toggling use of QGraphicsView
+        https://bugs.webkit.org/show_bug.cgi?id=48440
+
+        Preserve user input when toggling use of QGraphicsView
+
+        * QtTestBrowser/launcherwindow.cpp:
+        (LauncherWindow::initializeView):
+        (LauncherWindow::loadFinished):
+        * QtTestBrowser/launcherwindow.h:
+        * QtTestBrowser/mainwindow.cpp:
+        (MainWindow::addressUrl):
+        * QtTestBrowser/mainwindow.h:
+
 2011-01-27  Dirk Pranke  <dpranke@chromium.org>
 
         Reviewed by Mihai Parparita.
index 092bba77c028864ed9c48afef5c4743a9f5f8e68..666942f4edfb4ed337166d654cefacba94dd5816 100644 (file)
@@ -96,6 +96,7 @@ void LauncherWindow::initializeView()
 {
     delete m_view;
 
+    m_inputUrl = addressUrl();
     QUrl url = page()->mainFrame()->url();
     setPage(new WebPage(this));
     page()->setQnamThreaded(m_windowOptions.useThreadedQnam);
@@ -142,6 +143,10 @@ void LauncherWindow::initializeView()
 
     if (url.isValid())
         page()->mainFrame()->load(url);
+    else  {
+        setAddressUrl(m_inputUrl);
+        m_inputUrl = QString();
+    }
 }
 
 void LauncherWindow::applyPrefs()
@@ -538,8 +543,13 @@ void LauncherWindow::loadStarted()
 void LauncherWindow::loadFinished()
 {
     QUrl url = page()->mainFrame()->url();
-    setAddressUrl(url.toString(QUrl::RemoveUserInfo));
     addCompleterEntry(url);
+    if (m_inputUrl.isEmpty())
+        setAddressUrl(url.toString(QUrl::RemoveUserInfo));
+    else {
+        setAddressUrl(m_inputUrl);
+        m_inputUrl = QString();
+    }
 }
 
 void LauncherWindow::showLinkHover(const QString &link, const QString &toolTip)
index 25671357f4a490d7daa2d8690ee2775daa666939..4487f658ac110bfe47c192e0aa1366661fab2c56 100644 (file)
@@ -208,6 +208,8 @@ private:
     QPropertyAnimation* m_zoomAnimation;
     QList<QTouchEvent::TouchPoint> m_touchPoints;
     bool m_touchMocking;
+
+    QString m_inputUrl;
 };
 
 #endif
index 9f4aec50a8642e8f16b581b57395456cb45dd18d..e2ea41d91863d3a4c7555df6150af03b778be6a8 100644 (file)
@@ -171,6 +171,14 @@ void MainWindow::load(const QUrl& url)
     page()->mainFrame()->load(url);
 }
 
+QString MainWindow::addressUrl() const
+{
+#ifndef QT_NO_INPUTDIALOG
+    return urlEdit->text();
+#endif
+    return QString();
+}
+
 void MainWindow::changeLocation()
 {
 #ifndef QT_NO_INPUTDIALOG
index 3a39d57ef4c81f799e1bbafb50a5289eb4645576..08fa81eade7a90348c52c2423bc4458b54fa3287 100644 (file)
@@ -59,6 +59,9 @@ protected slots:
     void openLocation();
     void changeLocation();
 
+protected:
+    QString addressUrl() const;
+
 private:
     void buildUI();