From e3e178e07c58f78eaa7066a64d2e6dd9acd66bd3 Mon Sep 17 00:00:00 2001
From: Aqua-sama <aqua@iserlohn-fortress.net>
Date: Wed, 6 Feb 2019 21:58:33 +0200
Subject: Use spdlog for logging

---
 src/webengine/webpage.cpp | 5 ++---
 src/webengine/webview.cpp | 5 +----
 2 files changed, 3 insertions(+), 7 deletions(-)

(limited to 'src/webengine')

diff --git a/src/webengine/webpage.cpp b/src/webengine/webpage.cpp
index ecbb1b9..15d2322 100644
--- a/src/webengine/webpage.cpp
+++ b/src/webengine/webpage.cpp
@@ -12,6 +12,7 @@
 #include <QTimer>
 #include <QWebEngineFullScreenRequest>
 #include <QWebEngineCertificateError>
+#include <spdlog/spdlog.h>
 
 QString tr_terminationStatus(QWebEnginePage::RenderProcessTerminationStatus status)
 {
@@ -114,9 +115,7 @@ void WebPage::featurePermissionDialog(const QUrl &securityOrigin, QWebEnginePage
 void WebPage::renderProcessCrashed(QWebEnginePage::RenderProcessTerminationStatus terminationStatus, int exitCode)
 {
     if(terminationStatus != QWebEnginePage::NormalTerminationStatus) {
-#ifdef QT_DEBUG
-        qDebug("render process terminated: [%i] %i", terminationStatus, exitCode);
-#endif
+        spdlog::warn("render process terminated: [{}] {}", terminationStatus, exitCode);
 
         QString page = "<html><body><h1>This tab has crashed!</h1>%message%</body></html>";
         page.replace(QLatin1String("%message%"), QString("<p>%1<br>Exit code is %2.</p>"
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 5e350eb..5c9ab26 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -87,10 +87,7 @@ void WebView::search(const QString &term)
 
 WebView *WebView::createWindow(QWebEnginePage::WebWindowType type)
 {
-    if(m_parentWindow == nullptr) {
-        qDebug("WebView::createWindow: parent window not found, returning nullptr");
-        return nullptr;
-    }
+    Q_CHECK_PTR(m_parentWindow);
 
     // parent Window has been found
     auto index = m_parentWindow->addTab();
-- 
cgit v1.2.1