From af7da146be4f4c9db69d85e33cc7229bb775e5b2 Mon Sep 17 00:00:00 2001 From: aqua Date: Sat, 3 Sep 2022 14:05:27 +0300 Subject: Add rekonq::DefaultUrl enum --- src/application.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/application.cpp') diff --git a/src/application.cpp b/src/application.cpp index 944d6ea1..295d2708 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -20,10 +20,6 @@ #include #include -#ifdef QT_DEBUG -#include "test/rview_fake.h" -#endif - // --------------------------------------------------------------------------------------------------------------- // Ctor and Dtor @@ -388,20 +384,19 @@ RekonqWindow *Application::newWindow() RekonqView *Application::newView(const QUrl &url, RekonqWindow *window) { RekonqView *view = nullptr; + const auto _url = url.isEmpty() ? m_settings->value("homepage").toUrl() : url; -#ifdef QT_DEBUG - if (url.isEmpty()) view = new RekonqView_fake(window); -#endif - - if (view == nullptr) - for (const auto &plugin : m_plugins) { - if (plugin->hasScheme(url.scheme())) { - view = plugin->interface()->view(url.isEmpty() ? m_settings->value("homepage").toUrl() : url); - break; - } + for (const auto &plugin : m_plugins) { + if (plugin->hasScheme(_url.scheme())) { + view = plugin->interface()->view(_url); + break; } + } - if (view == nullptr) return view; + if (view == nullptr) { + spdlog::error("Cannot find plugin for url={}", qUtf8Printable(_url.toString())); + return view; + } Q_CHECK_PTR(view); // tab->installEventFilter(this); -- cgit v1.2.1