]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/BrowserWindow.cpp
Improve initialization order.
[PrivacyBrowserPC.git] / src / BrowserWindow.cpp
index a2eda98e36b5a23aefcc2ca5bcb8c9ef329bf02a..7e908a34dff6a876eba5e340c8f82c69ba2191c0 100644 (file)
@@ -132,18 +132,14 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     // Display dialogs.
     connect(zoomFactorActionPointer, SIGNAL(triggered()), this, SLOT(getZoomFactorFromUser()));
 
-    // Set the current zoom factor.
-    currentZoomFactor = Settings::zoomFactor();
-
-    // Initialize the on-the-fly menus, as the slot connections had not been created when MainView was constructed.
-    updateOnTheFlyZoomFactor(currentZoomFactor);
-    updateOnTheFlySearchEngine(Settings::searchEngine());
-
     // Update the status bar with the URL when a link is hovered.
     connect(mainViewPointer, SIGNAL(linkHovered(QString)), this, SLOT(updateStatusBar(QString)));
 
     // Setup the GUI based on the privacybrowserui.rc file.
     setupGUI();
+
+    // Load the initial webstie.
+    mainViewPointer->loadInitialWebsite();
 }
 
 void BrowserWindow::fileNew() const
@@ -349,8 +345,11 @@ void BrowserWindow::updateOnTheFlyUserAgent(const QString &userAgent) const
     }
 }
 
-void BrowserWindow::updateOnTheFlyZoomFactor(const double &zoomFactor) const
+void BrowserWindow::updateOnTheFlyZoomFactor(const double &zoomFactor)
 {
+    // Set the current zoom factor.
+    currentZoomFactor = Settings::zoomFactor();
+
     // Update the zoom factor action text, formatting the double with 2 decimal places.
     zoomFactorActionPointer->setText(ki18nc("@action", "Zoom Factor - %1").subs(zoomFactor, 0, '0', 2).toString());
 }