summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 88466d73..63263278 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -387,29 +387,20 @@ RekonqWindow *Application::newWindow()
RekonqView *Application::newView(const QUrl &url, RekonqWindow *window)
{
+ RekonqView *view = nullptr;
+
#ifdef QT_DEBUG
- if (url.isEmpty()) {
- auto *view = new RekonqView_fake(window);
- if (window == nullptr) {
- m_views.append(view);
- view->show();
- }
- else
- window->addView(view);
- return view;
- }
+ if (url.isEmpty()) view = new RekonqView_fake(window);
+ else
#endif
-
- RekonqPluginInterface *interface = nullptr;
- for (const auto &plugin : m_plugins)
- if (plugin->hasScheme(url.scheme())) {
- interface = plugin->interface();
- break;
+ for (const auto &plugin : m_plugins) {
+ if (plugin->hasScheme(url.scheme())) {
+ view = plugin->interface()->view(url);
+ break;
+ }
}
- if (interface == nullptr) return nullptr;
-
- auto *view = interface->view(url);
+ if (view == nullptr) return view;
Q_CHECK_PTR(view);
// tab->installEventFilter(this);