summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application.cpp5
-rw-r--r--src/application.hpp1
-rw-r--r--src/application_instance.cpp3
-rw-r--r--src/test/rview_fake.cpp18
-rw-r--r--src/test/rview_fake.h7
5 files changed, 23 insertions, 11 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 63263278..d18c0231 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -391,11 +391,12 @@ RekonqView *Application::newView(const QUrl &url, RekonqWindow *window)
#ifdef QT_DEBUG
if (url.isEmpty()) view = new RekonqView_fake(window);
- else
#endif
+
+ if (view == nullptr)
for (const auto &plugin : m_plugins) {
if (plugin->hasScheme(url.scheme())) {
- view = plugin->interface()->view(url);
+ view = plugin->interface()->view(url.isEmpty() ? m_settings->value("homepage").toUrl() : url);
break;
}
}
diff --git a/src/application.hpp b/src/application.hpp
index 95390f16..cc38bda9 100644
--- a/src/application.hpp
+++ b/src/application.hpp
@@ -12,7 +12,6 @@
#pragma once
#include "rekonq.hpp"
-#include "rekonqwindow.h"
#include <QPointer>
#include <QUrl>
#include <QWidget>
diff --git a/src/application_instance.cpp b/src/application_instance.cpp
index a82e9a72..8c744d10 100644
--- a/src/application_instance.cpp
+++ b/src/application_instance.cpp
@@ -9,7 +9,6 @@
* ============================================================ */
#include "application.hpp"
-#include "rsettings.hpp"
#include <QCommandLineParser>
static const char *description = "A lightweight Web Browser based on Qt WebEngine";
@@ -50,7 +49,7 @@ void Application::parseCommandLine(quint32 instanceId, const QByteArray &message
else {
// create main window
auto *window = newWindow();
- if (positionalArguments.isEmpty()) newView(m_settings->value("homepage").toUrl(), window);
+ if (positionalArguments.isEmpty()) newView(QUrl(), window);
else
for (const auto &url : positionalArguments) newView(QUrl::fromUserInput(url), window);
}
diff --git a/src/test/rview_fake.cpp b/src/test/rview_fake.cpp
index bb7e91d6..77a787c9 100644
--- a/src/test/rview_fake.cpp
+++ b/src/test/rview_fake.cpp
@@ -1,6 +1,12 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================ */
+
#include "rview_fake.h"
#include "ui_rview_fake.h"
-#include <source_location>
#include <spdlog/spdlog.h>
RekonqView_fake::RekonqView_fake(QWidget *parent) : RekonqView(QUrl(), parent), ui(new Ui::RekonqView_fake)
@@ -31,26 +37,26 @@ RekonqView_fake::~RekonqView_fake() { delete ui; }
void RekonqView_fake::load(const QUrl &url)
{
ui->url->setText(url.toString());
- spdlog::debug("{} url={}", std::source_location::current().function_name(), qUtf8Printable(url.toString()));
+ spdlog::debug("{} url={}", __PRETTY_FUNCTION__, qUtf8Printable(url.toString()));
}
int RekonqView_fake::progress() const
{
- spdlog::debug("{} -> {}", std::source_location::current().function_name(), ui->progress->value());
+ spdlog::debug("{} -> {}", __PRETTY_FUNCTION__, ui->progress->value());
return ui->progress->value();
}
QIcon RekonqView_fake::icon() const
{
- spdlog::debug("{} -> empty QIcon", std::source_location::current().function_name());
+ spdlog::debug("{} -> empty QIcon", __PRETTY_FUNCTION__);
return {};
}
QString RekonqView_fake::title() const
{
- spdlog::debug("{} -> {}", std::source_location::current().function_name(), qUtf8Printable(ui->title->text()));
+ spdlog::debug("{} -> {}", __PRETTY_FUNCTION__, qUtf8Printable(ui->title->text()));
return ui->title->text();
}
QUrl RekonqView_fake::url() const
{
- spdlog::debug("{} -> {}", std::source_location::current().function_name(), qUtf8Printable(ui->url->text()));
+ spdlog::debug("{} -> {}", __PRETTY_FUNCTION__, qUtf8Printable(ui->url->text()));
return {ui->url->text()};
}
diff --git a/src/test/rview_fake.h b/src/test/rview_fake.h
index 64a8351d..33685e7c 100644
--- a/src/test/rview_fake.h
+++ b/src/test/rview_fake.h
@@ -1,3 +1,10 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================ */
+
#pragma once
#include <rview.hpp>