[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 11:42:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0728a38175aad6fd1f35330686d91cf240623e49
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 4 20:31:07 2010 +0000

    2010-08-04  Antonio Gomes  <tonikitoo at webkit.org>
    
            Reviewed by Simon Hausmann and Kenneth Christiansen.
    
            [Qt] [QtTestBrowser] Clean up static and global menu state controls
            https://bugs.webkit.org/show_bug.cgi?id=43448
    
            After LauncherWindow class was refactored out of from main.cpp, all global variables that
            were hanging in main.cpp became temporarily public static class members of newly added
            LauncherWindow class. This design was not properly handling the initial purpose of the
            global variables: newly created launcher windows should inherit the settings of the originating
            one.
    
            In order to properly fix the problem, this patch introduces a WindowOptions class, as a POD. It
            comprises all data needed to handling the goal described above.
    
            * QtTestBrowser/launcherwindow.cpp:
            (LauncherWindow::LauncherWindow): The class now receives an optional WindowOptions pointer object
                                              holding all user settings configured in the menus and command line.
                                              It also receices an optional QGraphicsScene points in case we are doing
                                              a "Clone Window".
            (LauncherWindow::init): Removed the usesGraphics parameter because the class member m_userData holds its
                                    value.
            (LauncherWindow::initializeView): Ditto.
            (LauncherWindow::createChrome): Changed all references to gXXX to m_userData.XXX
            (LauncherWindow::applyPrefs): Removed the "LauncherWindow* source" parameter. All data needed to properly
                                          apply the preferences is provided by m_userData.
            (LauncherWindow::toggleAcceleratedCompositing): Change gXXX by m_userData.XXX
            (LauncherWindow::toggleResizesToContents): Ditto.
            (LauncherWindow::toggleWebGL): Ditto.
            (LauncherWindow::toggleFrameFlattening): Ditto.
            (LauncherWindow::toggleQGLWidgetViewport): Ditto.
            (LauncherWindow::changeViewportUpdateMode): Ditto.
            (LauncherWindow::showFPS): Ditto.
            (LauncherWindow::newWindow): Changed to pass the userData.
            (LauncherWindow::cloneWindow): Ditto.
            * QtTestBrowser/launcherwindow.h:
            (WindowOptions::WindowOptions):
            * QtTestBrowser/main.cpp:
            (requiresGraphicsView):
            (LauncherApplication::handleUserOptions):
            (main):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64673 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 938c898..d00f8c4 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,46 @@
+2010-08-04  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Simon Hausmann and Kenneth Christiansen.
+
+        [Qt] [QtTestBrowser] Clean up static and global menu state controls
+        https://bugs.webkit.org/show_bug.cgi?id=43448
+
+        After LauncherWindow class was refactored out of from main.cpp, all global variables that
+        were hanging in main.cpp became temporarily public static class members of newly added
+        LauncherWindow class. This design was not properly handling the initial purpose of the
+        global variables: newly created launcher windows should inherit the settings of the originating
+        one.
+
+        In order to properly fix the problem, this patch introduces a WindowOptions class, as a POD. It
+        comprises all data needed to handling the goal described above.
+
+        * QtTestBrowser/launcherwindow.cpp:
+        (LauncherWindow::LauncherWindow): The class now receives an optional WindowOptions pointer object
+                                          holding all user settings configured in the menus and command line.
+                                          It also receices an optional QGraphicsScene points in case we are doing
+                                          a "Clone Window".
+        (LauncherWindow::init): Removed the usesGraphics parameter because the class member m_userData holds its
+                                value.
+        (LauncherWindow::initializeView): Ditto.
+        (LauncherWindow::createChrome): Changed all references to gXXX to m_userData.XXX
+        (LauncherWindow::applyPrefs): Removed the "LauncherWindow* source" parameter. All data needed to properly
+                                      apply the preferences is provided by m_userData.
+        (LauncherWindow::toggleAcceleratedCompositing): Change gXXX by m_userData.XXX
+        (LauncherWindow::toggleResizesToContents): Ditto.
+        (LauncherWindow::toggleWebGL): Ditto.
+        (LauncherWindow::toggleFrameFlattening): Ditto.
+        (LauncherWindow::toggleQGLWidgetViewport): Ditto.
+        (LauncherWindow::changeViewportUpdateMode): Ditto.
+        (LauncherWindow::showFPS): Ditto.
+        (LauncherWindow::newWindow): Changed to pass the userData.
+        (LauncherWindow::cloneWindow): Ditto.
+        * QtTestBrowser/launcherwindow.h:
+        (WindowOptions::WindowOptions):
+        * QtTestBrowser/main.cpp:
+        (requiresGraphicsView):
+        (LauncherApplication::handleUserOptions):
+        (main):
+
 2010-08-04  Kevin Ollivier  <kevino at theolliviers.com>
 
         [wx] Build fix for gcc not importing all symbols from convenience libraries.
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
index 52772f5..54e6d19 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -32,26 +32,9 @@
 
 #include "launcherwindow.h"
 
-bool LauncherWindow::gUseGraphicsView = false;
-bool LauncherWindow::gUseCompositing = true;
-bool LauncherWindow::gCacheWebView = false;
-bool LauncherWindow::gShowFrameRate = false;
-bool LauncherWindow::gResizesToContents = false;
-bool LauncherWindow::gUseTiledBackingStore = false;
-QGraphicsView::ViewportUpdateMode LauncherWindow::gViewportUpdateMode = QGraphicsView::MinimalViewportUpdate;
-QUrl LauncherWindow::gInspectorUrl;
-
-#if defined(Q_WS_MAEMO_5) || defined(Q_WS_S60)
-bool LauncherWindow::gUseFrameFlattening = true;
-#else
-bool LauncherWindow::gUseFrameFlattening = false;
-#endif
-
-#if defined(QT_CONFIGURED_WITH_OPENGL)
-bool LauncherWindow::gUseQGLWidgetViewport = false;
-#endif
+const int gExitClickArea = 80;
 
-LauncherWindow::LauncherWindow(LauncherWindow* other, bool shareScene)
+LauncherWindow::LauncherWindow(WindowOptions* data, QGraphicsScene* sharedScene)
     : MainWindow()
     , m_currentZoom(100)
     , m_view(0)
@@ -63,17 +46,13 @@ LauncherWindow::LauncherWindow(LauncherWindow* other, bool shareScene)
     , m_zoomAnimation(0)
 #endif
 {
-    if (other) {
-        init(other->isGraphicsBased());
-        applyPrefs(other);
-        if (shareScene && other->isGraphicsBased()) {
-            QGraphicsView* otherView = static_cast<QGraphicsView*>(other->m_view);
-            static_cast<QGraphicsView*>(m_view)->setScene(otherView->scene());
-        }
-    } else {
-        init(gUseGraphicsView);
-        applyPrefs();
-    }
+    if (data)
+        m_windowOptions = *data;
+
+    init();
+    applyPrefs();
+    if (sharedScene && data->useGraphicsView)
+        static_cast<QGraphicsView*>(m_view)->setScene(sharedScene);
 
     createChrome();
 }
@@ -83,7 +62,7 @@ LauncherWindow::~LauncherWindow()
     grabZoomKeys(false);
 }
 
-void LauncherWindow::init(bool useGraphicsView)
+void LauncherWindow::init()
 {
     QSplitter* splitter = new QSplitter(Qt::Vertical, this);
     setCentralWidget(splitter);
@@ -95,7 +74,7 @@ void LauncherWindow::init(bool useGraphicsView)
     resize(800, 600);
 #endif
 
-    initializeView(useGraphicsView);
+    initializeView();
 
     connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
     connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
@@ -105,8 +84,8 @@ void LauncherWindow::init(bool useGraphicsView)
 
     m_inspector = new WebInspector(splitter);
 #ifndef QT_NO_PROPERTIES
-    if (!gInspectorUrl.isEmpty())
-        m_inspector->setProperty("_q_inspectorUrl", gInspectorUrl);
+    if (!m_windowOptions.inspectorUrl.isEmpty())
+        m_inspector->setProperty("_q_inspectorUrl", m_windowOptions.inspectorUrl);
 #endif
     m_inspector->setPage(page());
     m_inspector->hide();
@@ -120,13 +99,13 @@ void LauncherWindow::init(bool useGraphicsView)
     grabZoomKeys(true);
 }
 
-void LauncherWindow::initializeView(bool useGraphicsView)
+void LauncherWindow::initializeView()
 {
     delete m_view;
 
     QSplitter* splitter = static_cast<QSplitter*>(centralWidget());
 
-    if (!useGraphicsView) {
+    if (!m_windowOptions.useGraphicsView) {
         WebViewTraditional* view = new WebViewTraditional(splitter);
         view->setPage(page());
 
@@ -277,20 +256,20 @@ void LauncherWindow::createChrome()
 
     QAction* toggleResizesToContents = graphicsViewMenu->addAction("Toggle Resizes To Contents Mode", this, SLOT(toggleResizesToContents(bool)));
     toggleResizesToContents->setCheckable(true);
-    toggleResizesToContents->setChecked(gResizesToContents);
+    toggleResizesToContents->setChecked(m_windowOptions.resizesToContents);
     toggleResizesToContents->setEnabled(isGraphicsBased());
     toggleResizesToContents->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
 
     QAction* toggleTiledBackingStore = graphicsViewMenu->addAction("Toggle Tiled Backing Store", this, SLOT(toggleTiledBackingStore(bool)));
     toggleTiledBackingStore->setCheckable(true);
-    toggleTiledBackingStore->setChecked(false);
+    toggleResizesToContents->setChecked(m_windowOptions.useTiledBackingStore);
     toggleTiledBackingStore->setEnabled(isGraphicsBased());
     toggleTiledBackingStore->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
 
 #if defined(QT_CONFIGURED_WITH_OPENGL)
     QAction* toggleQGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QGLWidget Viewport", this, SLOT(toggleQGLWidgetViewport(bool)));
     toggleQGLWidgetViewport->setCheckable(true);
-    toggleQGLWidgetViewport->setChecked(gUseQGLWidgetViewport);
+    toggleQGLWidgetViewport->setChecked(m_windowOptions.useQGLWidgetViewport);
     toggleQGLWidgetViewport->setEnabled(isGraphicsBased());
     toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
 #endif
@@ -301,23 +280,23 @@ void LauncherWindow::createChrome()
 
     QAction* fullUpdate = viewportUpdateMenu->addAction("FullViewportUpdate");
     fullUpdate->setCheckable(true);
-    fullUpdate->setChecked((gViewportUpdateMode == QGraphicsView::FullViewportUpdate) ? true : false);
+    fullUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::FullViewportUpdate) ? true : false);
 
     QAction* minimalUpdate = viewportUpdateMenu->addAction("MinimalViewportUpdate");
     minimalUpdate->setCheckable(true);
-    minimalUpdate->setChecked((gViewportUpdateMode == QGraphicsView::MinimalViewportUpdate) ? true : false);
+    minimalUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::MinimalViewportUpdate) ? true : false);
 
     QAction* smartUpdate = viewportUpdateMenu->addAction("SmartViewportUpdate");
     smartUpdate->setCheckable(true);
-    smartUpdate->setChecked((gViewportUpdateMode == QGraphicsView::SmartViewportUpdate) ? true : false);
+    smartUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::SmartViewportUpdate) ? true : false);
 
     QAction* boundingRectUpdate = viewportUpdateMenu->addAction("BoundingRectViewportUpdate");
     boundingRectUpdate->setCheckable(true);
-    boundingRectUpdate->setChecked((gViewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) ? true : false);
+    boundingRectUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) ? true : false);
 
     QAction* noUpdate = viewportUpdateMenu->addAction("NoViewportUpdate");
     noUpdate->setCheckable(true);
-    noUpdate->setChecked((gViewportUpdateMode == QGraphicsView::NoViewportUpdate) ? true : false);
+    noUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::NoViewportUpdate) ? true : false);
 
     QSignalMapper* signalMapper = new QSignalMapper(viewportUpdateMenu);
     signalMapper->setMapping(fullUpdate, QGraphicsView::FullViewportUpdate);
@@ -367,7 +346,7 @@ void LauncherWindow::createChrome()
     showFPS->setCheckable(true);
     showFPS->setEnabled(isGraphicsBased());
     showFPS->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
-    showFPS->setChecked(gShowFrameRate);
+    showFPS->setChecked(m_windowOptions.showFrameRate);
 }
 
 bool LauncherWindow::isGraphicsBased() const
@@ -375,37 +354,25 @@ bool LauncherWindow::isGraphicsBased() const
     return bool(qobject_cast<QGraphicsView*>(m_view));
 }
 
-inline void applySetting(QWebSettings::WebAttribute type, QWebSettings* settings, QWebSettings* other, bool defaultValue)
-{
-    settings->setAttribute(type, other ? other->testAttribute(type) : defaultValue);
-}
-
-void LauncherWindow::applyPrefs(LauncherWindow* source)
+void LauncherWindow::applyPrefs()
 {
-    QWebSettings* other = source ? source->page()->settings() : 0;
     QWebSettings* settings = page()->settings();
-
-    applySetting(QWebSettings::AcceleratedCompositingEnabled, settings, other, gUseCompositing);
-    applySetting(QWebSettings::TiledBackingStoreEnabled, settings, other, gUseTiledBackingStore);
-    applySetting(QWebSettings::WebGLEnabled, settings, other, false);
-    applySetting(QWebSettings::FrameFlatteningEnabled, settings, other, gUseFrameFlattening);
+    settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, m_windowOptions.useCompositing);
+    settings->setAttribute(QWebSettings::TiledBackingStoreEnabled, m_windowOptions.useTiledBackingStore);
+    settings->setAttribute(QWebSettings::FrameFlatteningEnabled, m_windowOptions.useFrameFlattening);
+    settings->setAttribute(QWebSettings::WebGLEnabled, m_windowOptions.useWebGL);
 
     if (!isGraphicsBased())
         return;
 
     WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
-    WebViewGraphicsBased* otherView = source ? qobject_cast<WebViewGraphicsBased*>(source->m_view) : 0;
-
-    view->setViewportUpdateMode(otherView ? otherView->viewportUpdateMode() : gViewportUpdateMode);
-    view->setFrameRateMeasurementEnabled(otherView ? otherView->frameRateMeasurementEnabled() : gShowFrameRate);
+    view->setViewportUpdateMode(m_windowOptions.viewportUpdateMode);
+    view->setFrameRateMeasurementEnabled(m_windowOptions.showFrameRate);
+    view->setItemCacheMode(m_windowOptions.cacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
 
-    if (otherView) {
-        view->setItemCacheMode(otherView->itemCacheMode());
-        view->setResizesToContents(otherView->resizesToContents());
-        view->setCustomLayoutSize(otherView->customLayoutSize());
-    } else {
-        view->setItemCacheMode(gCacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
-        toggleResizesToContents(gResizesToContents);
+    if (m_windowOptions.resizesToContents) {
+        view->setCustomLayoutSize(size());
+        toggleResizesToContents(m_windowOptions.resizesToContents);
     }
 }
 
@@ -712,7 +679,7 @@ void LauncherWindow::setTouchMocking(bool on)
 
 void LauncherWindow::toggleAcceleratedCompositing(bool toggle)
 {
-    gUseCompositing = toggle;
+    m_windowOptions.useCompositing = toggle;
     page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, toggle);
 }
 
@@ -723,12 +690,13 @@ void LauncherWindow::toggleTiledBackingStore(bool toggle)
 
 void LauncherWindow::toggleResizesToContents(bool toggle)
 {
-    gResizesToContents = toggle;
+    m_windowOptions.resizesToContents = toggle;
     static_cast<WebViewGraphicsBased*>(m_view)->setResizesToContents(toggle);
 }
 
 void LauncherWindow::toggleWebGL(bool toggle)
 {
+    m_windowOptions.useWebGL = toggle;
     page()->settings()->setAttribute(QWebSettings::WebGLEnabled, toggle);
 }
 
@@ -752,7 +720,7 @@ void LauncherWindow::toggleFullScreenMode(bool enable)
 
 void LauncherWindow::toggleFrameFlattening(bool toggle)
 {
-    gUseFrameFlattening = toggle;
+    m_windowOptions.useFrameFlattening = toggle;
     page()->settings()->setAttribute(QWebSettings::FrameFlatteningEnabled, toggle);
 }
 
@@ -772,7 +740,7 @@ void LauncherWindow::toggleQGLWidgetViewport(bool enable)
     if (!isGraphicsBased())
         return;
 
-    gUseQGLWidgetViewport = enable;
+    m_windowOptions.useQGLWidgetViewport = enable;
     WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
 
     view->setViewport(enable ? new QGLWidget() : 0);
@@ -781,13 +749,13 @@ void LauncherWindow::toggleQGLWidgetViewport(bool enable)
 
 void LauncherWindow::changeViewportUpdateMode(int mode)
 {
-    gViewportUpdateMode = QGraphicsView::ViewportUpdateMode(mode);
+    m_windowOptions.viewportUpdateMode = QGraphicsView::ViewportUpdateMode(mode);
 
     if (!isGraphicsBased())
         return;
 
     WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
-    view->setViewportUpdateMode(gViewportUpdateMode);
+    view->setViewportUpdateMode(m_windowOptions.viewportUpdateMode);
 }
 
 void LauncherWindow::showFPS(bool enable)
@@ -795,7 +763,7 @@ void LauncherWindow::showFPS(bool enable)
     if (!isGraphicsBased())
         return;
 
-    gShowFrameRate = enable;
+    m_windowOptions.showFrameRate = enable;
     WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
     view->setFrameRateMeasurementEnabled(enable);
 
@@ -868,14 +836,14 @@ void LauncherWindow::updateFPS(int fps)
 
 LauncherWindow* LauncherWindow::newWindow()
 {
-    LauncherWindow* mw = new LauncherWindow(this, false);
+    LauncherWindow* mw = new LauncherWindow(&m_windowOptions);
     mw->show();
     return mw;
 }
 
 LauncherWindow* LauncherWindow::cloneWindow()
 {
-    LauncherWindow* mw = new LauncherWindow(this, true);
+    LauncherWindow* mw = new LauncherWindow(&m_windowOptions, qobject_cast<QGraphicsView*>(m_view)->scene());
     mw->show();
     return mw;
 }
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.h b/WebKitTools/QtTestBrowser/launcherwindow.h
index f9f157d..9595901 100644
--- a/WebKitTools/QtTestBrowser/launcherwindow.h
+++ b/WebKitTools/QtTestBrowser/launcherwindow.h
@@ -75,11 +75,48 @@
 #undef KeyPress
 #endif
 
+class WindowOptions {
+public:
+    WindowOptions()
+        : useGraphicsView(false)
+        , useCompositing(true)
+        , useTiledBackingStore(false)
+        , useWebGL(false)
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_S60)
+        , useFrameFlattening(true)
+#else
+        , useFrameFlattening(false)
+#endif
+        , cacheWebView(false)
+        , showFrameRate(false)
+        , resizesToContents(false)
+        , viewportUpdateMode(QGraphicsView::MinimalViewportUpdate)
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+        , useQGLWidgetViewport(false)
+#endif
+    {
+    }
+
+    bool useGraphicsView;
+    bool useCompositing;
+    bool useTiledBackingStore;
+    bool useWebGL;
+    bool useFrameFlattening;
+    bool cacheWebView;
+    bool showFrameRate;
+    bool resizesToContents;
+    QGraphicsView::ViewportUpdateMode viewportUpdateMode;
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+    bool useQGLWidgetViewport;
+#endif
+    QUrl inspectorUrl;
+};
+
 class LauncherWindow : public MainWindow {
     Q_OBJECT
 
 public:
-    LauncherWindow(LauncherWindow* other = 0, bool shareScene = false);
+    LauncherWindow(WindowOptions* data = 0, QGraphicsScene* sharedScene = 0);
     virtual ~LauncherWindow();
 
     virtual void keyPressEvent(QKeyEvent* event);
@@ -91,22 +128,6 @@ public:
 
     bool eventFilter(QObject* obj, QEvent* event);
 
-public:
-    static const int gExitClickArea = 80;
-    static bool gUseGraphicsView;
-    static bool gUseCompositing;
-    static bool gCacheWebView;
-    static bool gShowFrameRate;
-    static bool gResizesToContents;
-    static bool gUseTiledBackingStore;
-    static bool gUseFrameFlattening;
-    static QGraphicsView::ViewportUpdateMode gViewportUpdateMode;
-    static QUrl gInspectorUrl;
-
-#if defined(QT_CONFIGURED_WITH_OPENGL)
-    static bool gUseQGLWidgetViewport;
-#endif
-
 protected slots:
     void loadStarted();
     void loadFinished();
@@ -127,7 +148,7 @@ protected slots:
     /* void dumpPlugins() */
     void dumpHtml();
 
-    void initializeView(bool useGraphicsView = false);
+    void initializeView();
 
     void setTouchMocking(bool on);
     void toggleAcceleratedCompositing(bool toggle);
@@ -158,10 +179,10 @@ signals:
     void enteredFullScreenMode(bool on);
 
 private:
-    void init(bool useGraphicsView = false);
+    void init();
     bool isGraphicsBased() const;
     void createChrome();
-    void applyPrefs(LauncherWindow* other = 0);
+    void applyPrefs();
     void applyZoom();
 
 private:
@@ -171,6 +192,8 @@ private:
     QWidget* m_view;
     WebInspector* m_inspector;
 
+    WindowOptions m_windowOptions;
+
     QAction* m_formatMenuAction;
     QAction* m_flipAnimated;
     QAction* m_flipYAnimated;
diff --git a/WebKitTools/QtTestBrowser/main.cpp b/WebKitTools/QtTestBrowser/main.cpp
index 33a6416..842290b 100644
--- a/WebKitTools/QtTestBrowser/main.cpp
+++ b/WebKitTools/QtTestBrowser/main.cpp
@@ -33,6 +33,8 @@
 #include "launcherwindow.h"
 #include "urlloader.h"
 
+WindowOptions windowOptions;
+
 int launcherMain(const QApplication& app)
 {
 #ifndef NDEBUG
@@ -89,7 +91,7 @@ LauncherApplication::LauncherApplication(int& argc, char** argv)
 
 static void requiresGraphicsView(const QString& option)
 {
-    if (LauncherWindow::gUseGraphicsView)
+    if (windowOptions.useGraphicsView)
         return;
     appQuit(1, QString("%1 only works in combination with the -graphicsbased option").arg(option));
 }
@@ -121,31 +123,31 @@ void LauncherApplication::handleUserOptions()
     }
 
     if (args.contains("-graphicsbased"))
-        LauncherWindow::gUseGraphicsView = true;
+        windowOptions.useGraphicsView = true;
 
     if (args.contains("-no-compositing")) {
         requiresGraphicsView("-no-compositing");
-        LauncherWindow::gUseCompositing = false;
+        windowOptions.useCompositing = false;
     }
 
     if (args.contains("-show-fps")) {
         requiresGraphicsView("-show-fps");
-        LauncherWindow::gShowFrameRate = true;
+        windowOptions.showFrameRate = true;
     }
 
     if (args.contains("-cache-webview")) {
         requiresGraphicsView("-cache-webview");
-        LauncherWindow::gCacheWebView = true;
+        windowOptions.cacheWebView = true;
     }
 
     if (args.contains("-tiled-backing-store")) {
         requiresGraphicsView("-tiled-backing-store");
-        LauncherWindow::gUseTiledBackingStore = true;
+        windowOptions.useTiledBackingStore = true;
     }
 
     if (args.contains("-resizes-to-contents")) {
         requiresGraphicsView("-resizes-to-contents");
-        LauncherWindow::gResizesToContents = true;
+        windowOptions.resizesToContents = true;
     }
 
     QString arg1("-viewport-update-mode");
@@ -160,13 +162,13 @@ void LauncherApplication::handleUserOptions()
         if (idx == -1)
             appQuit(1, QString("%1 value has to be one of [%2]").arg(arg1).arg(formatKeys(updateModes)));
 
-        LauncherWindow::gViewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
+        windowOptions.viewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
     }
 
     QString inspectorUrlArg("-inspector-url");
     int inspectorUrlIndex = args.indexOf(inspectorUrlArg);
     if (inspectorUrlIndex != -1)
-       LauncherWindow::gInspectorUrl = takeOptionValue(&args, inspectorUrlIndex);
+       windowOptions.inspectorUrl = takeOptionValue(&args, inspectorUrlIndex);
 
     int robotIndex = args.indexOf("-r");
     if (robotIndex != -1) {
@@ -213,7 +215,7 @@ int main(int argc, char **argv)
     foreach (QString url, urls) {
         LauncherWindow* newWindow;
         if (!window)
-            newWindow = window = new LauncherWindow();
+            newWindow = window = new LauncherWindow(&windowOptions);
         else
             newWindow = window->newWindow();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list