[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tonikitoo at webkit.org tonikitoo at webkit.org
Wed Dec 22 13:29:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 06b36925f41a5b9ab0dcdf298c5f9f2b13c7e1b9
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 17 01:34:20 2010 +0000

    2010-09-16  Antonio Gomes  <tonikitoo at webkit.org>
    
            Reviewed by Andreas Kling.
    
            [Qt] When switching views (WebViewGraphicsBased <--> WebViewTraditional), QWebPage signals and QActions have to be re-set.
    
            Recently r67554 changed the way different views use the WebPage class: it was previously being shared between
            different views, but now for each view switch, a new WebPage class is constructed and set. Signals and QAction's
            were not being set to the new WebPage though. Patch fix that, by re constructing the toolbar, and then re-hooking
            all page specific stuff to the UI.
    
            * QtTestBrowser/launcherwindow.cpp:
            (LauncherWindow::initializeView):
            * QtTestBrowser/mainwindow.cpp:
            (MainWindow::MainWindow):
            (MainWindow::buildUI):
            (MainWindow::setPage):
            * QtTestBrowser/mainwindow.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67689 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 0ae9464..7ddd505 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-16  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] When switching views (WebViewGraphicsBased <--> WebViewTraditional), QWebPage signals and QActions have to be re-set.
+
+        Recently r67554 changed the way different views use the WebPage class: it was previously being shared between
+        different views, but now for each view switch, a new WebPage class is constructed and set. Signals and QAction's
+        were not being set to the new WebPage though. Patch fix that, by re constructing the toolbar, and then re-hooking
+        all page specific stuff to the UI.
+
+        * QtTestBrowser/launcherwindow.cpp:
+        (LauncherWindow::initializeView):
+        * QtTestBrowser/mainwindow.cpp:
+        (MainWindow::MainWindow):
+        (MainWindow::buildUI):
+        (MainWindow::setPage):
+        * QtTestBrowser/mainwindow.h:
+
 2010-09-12  Antonio Gomes  <tonikitoo at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
index 8c79154..65bcee7 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -103,10 +103,10 @@ void LauncherWindow::init()
 
 void LauncherWindow::initializeView()
 {
-    QUrl url = m_page->mainFrame()->url();
-    delete m_page;
     delete m_view;
-    m_page = new WebPage(this);
+
+    QUrl url = page()->mainFrame()->url();
+    setPage(new WebPage(this));
 
     QSplitter* splitter = static_cast<QSplitter*>(centralWidget());
 
@@ -132,7 +132,7 @@ void LauncherWindow::initializeView()
     }
 
     if (url.isValid())
-        m_page->mainFrame()->load(url);
+        page()->mainFrame()->load(url);
 
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     m_touchMocking = false;
diff --git a/WebKitTools/QtTestBrowser/mainwindow.cpp b/WebKitTools/QtTestBrowser/mainwindow.cpp
index 64aa5d9..fa8b87d 100644
--- a/WebKitTools/QtTestBrowser/mainwindow.cpp
+++ b/WebKitTools/QtTestBrowser/mainwindow.cpp
@@ -37,6 +37,7 @@
 
 MainWindow::MainWindow()
     : m_page(new WebPage(this))
+    , m_toolBar(0)
 {
     setAttribute(Qt::WA_DeleteOnClose);
     if (qgetenv("QTTESTBROWSER_USE_ARGB_VISUALS").toInt() == 1)
@@ -47,29 +48,31 @@ MainWindow::MainWindow()
 
 void MainWindow::buildUI()
 {
-    QToolBar* bar = addToolBar("Navigation");
+    delete m_toolBar;
+
+    m_toolBar = addToolBar("Navigation");
 #if defined(Q_OS_SYMBIAN)
-    bar->setIconSize(QSize(16, 16));
+    m_toolBar->setIconSize(QSize(16, 16));
 #endif
     QAction* reloadAction = page()->action(QWebPage::Reload);
     connect(reloadAction, SIGNAL(triggered()), this, SLOT(changeLocation()));
 
-    bar->addAction(page()->action(QWebPage::Back));
-    bar->addAction(page()->action(QWebPage::Forward));
-    bar->addAction(reloadAction);
-    bar->addAction(page()->action(QWebPage::Stop));
+    m_toolBar->addAction(page()->action(QWebPage::Back));
+    m_toolBar->addAction(page()->action(QWebPage::Forward));
+    m_toolBar->addAction(reloadAction);
+    m_toolBar->addAction(page()->action(QWebPage::Stop));
 
-    urlEdit = new LocationEdit(this);
+    urlEdit = new LocationEdit(m_toolBar);
     urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());
     connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
-    QCompleter* completer = new QCompleter(this);
+    QCompleter* completer = new QCompleter(m_toolBar);
     urlEdit->setCompleter(completer);
     completer->setModel(&urlModel);
 #if defined(Q_OS_SYMBIAN)
     addToolBarBreak();
     addToolBar("Location")->addWidget(urlEdit);
 #else
-    bar->addWidget(urlEdit);
+    m_toolBar->addWidget(urlEdit);
 #endif
 
     connect(page()->mainFrame(), SIGNAL(titleChanged(const QString&)),
@@ -94,6 +97,14 @@ void MainWindow::buildUI()
     page()->action(QWebPage::ToggleUnderline)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_U));
 }
 
+void MainWindow::setPage(WebPage* page)
+{
+    delete m_page;
+    m_page = page;
+
+    buildUI();
+}
+
 WebPage* MainWindow::page() const
 {
     return m_page;
diff --git a/WebKitTools/QtTestBrowser/mainwindow.h b/WebKitTools/QtTestBrowser/mainwindow.h
index 6afec23..3a39d57 100644
--- a/WebKitTools/QtTestBrowser/mainwindow.h
+++ b/WebKitTools/QtTestBrowser/mainwindow.h
@@ -50,6 +50,7 @@ public:
     void load(const QUrl& url);
 
     WebPage* page() const;
+    void setPage(WebPage*);
 
 protected slots:
     void setAddressUrl(const QString& url);
@@ -61,12 +62,11 @@ protected slots:
 private:
     void buildUI();
 
+    WebPage* m_page;
+    QToolBar* m_toolBar;
     QStringListModel urlModel;
     QStringList urlList;
     LocationEdit* urlEdit;
-
-protected:
-    WebPage* m_page;
 };
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list