X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fmainview.cpp;h=416014b6ba5b92c904816afd8e54a25930027b02;hp=3ebee4c4d02199ba260e47af8fb0262192b31b78;hb=a65c9f31cc84f245da08642cefefe7a17fa941ce;hpb=1cbda7a594e97dd3ba6e1c0675be6ec9f6a424b2 diff --git a/src/mainview.cpp b/src/mainview.cpp index 3ebee4c..416014b 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -22,14 +22,7 @@ #include "mainview.h" #include "mouseeventfilter.h" #include "settings.h" - -// KDE Framework headers. -#include - -// Qt headers. -#include -#include -#include +#include "ui_mainview.h" MainView::MainView(QWidget *parent) : QWidget(parent) { @@ -90,8 +83,20 @@ MainView::MainView(QWidget *parent) : QWidget(parent) // Set the focus on the WebEngine view. webEngineViewPointer->setFocus(); - // Load the homepage. - goHome(); + // Get the arguments. + QStringList argumentsStringList = qApp->arguments(); + + // Check to see if the arguments lists contains a URL. + if (argumentsStringList.size() > 1) + { + // Load the URL from the arguments list. + webEngineViewPointer->setUrl(QUrl::fromUserInput(argumentsStringList.at(1))); + } + else + { + // Load the homepage. + goHome(); + } } void MainView::applyApplicationSettings() @@ -164,7 +169,7 @@ void MainView::updateInterface() if (!urlLineEditPointer->hasFocus()) { // Update the URL line edit. - urlLineEditPointer->setUrl(webEngineViewPointer->url().toString()); + urlLineEditPointer->setText(webEngineViewPointer->url().toString()); } // Update the status of the forward and back buttons.