#include "mainview.h"
#include "mouseeventfilter.h"
#include "settings.h"
-
-// KDE Framework headers.
-#include <KLineEdit>
-
-// Qt headers.
-#include <QWebEngineHistory>
-#include <QWebEngineSettings>
-#include <QWebEngineView>
+#include "ui_mainview.h"
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()
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.