From 5e4b608751dca63d19c334ddb332b4e19741d175 Mon Sep 17 00:00:00 2001 From: aqua Date: Sun, 28 Aug 2022 08:46:08 +0300 Subject: Remove source_location --- src/application.cpp | 5 +++-- src/application.hpp | 1 - src/application_instance.cpp | 3 +-- src/test/rview_fake.cpp | 18 ++++++++++++------ src/test/rview_fake.h | 7 +++++++ 5 files changed, 23 insertions(+), 11 deletions(-) (limited to 'src') 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 #include #include 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 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 + * ============================================================ */ + #include "rview_fake.h" #include "ui_rview_fake.h" -#include #include 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 + * ============================================================ */ + #pragma once #include -- cgit v1.2.1