From a66e179b40e2d4d187cad9a21679a7adc105a04f Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 30 Mar 2016 11:51:55 +0200 Subject: [PATCH] Misc fixes Correctly initialize QJsonParserError --- src/lib/app/browserwindow.cpp | 1 - src/lib/bookmarks/bookmarksimport/chromeimporter.cpp | 4 ++-- src/lib/opensearch/opensearchengine.cpp | 2 +- src/plugins/GreaseMonkey/gm_urlinterceptor.cpp | 1 - src/plugins/MouseGestures/3rdparty/adv_recognizer.cpp | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index c093c6afb..1745a5d82 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -216,7 +216,6 @@ void BrowserWindow::postLaunch() if (m_startPage) { addTab = false; m_tabWidget->addView(QUrl()); - weView()->page()->deleteLater(); weView()->setPage(m_startPage); } diff --git a/src/lib/bookmarks/bookmarksimport/chromeimporter.cpp b/src/lib/bookmarks/bookmarksimport/chromeimporter.cpp index 2168ee535..f5d72a456 100644 --- a/src/lib/bookmarks/bookmarksimport/chromeimporter.cpp +++ b/src/lib/bookmarks/bookmarksimport/chromeimporter.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2014 David Rosca +* Copyright (C) 2010-2016 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ BookmarkItem* ChromeImporter::importBookmarks() m_file.close(); QJsonParseError err; - QJsonDocument json = QJsonDocument::fromJson(data); + QJsonDocument json = QJsonDocument::fromJson(data, &err); const QVariant res = json.toVariant(); if (err.error != QJsonParseError::NoError || res.type() != QVariant::Map) { diff --git a/src/lib/opensearch/opensearchengine.cpp b/src/lib/opensearch/opensearchengine.cpp index 8a7dae647..b9818a587 100644 --- a/src/lib/opensearch/opensearchengine.cpp +++ b/src/lib/opensearch/opensearchengine.cpp @@ -632,7 +632,7 @@ void OpenSearchEngine::suggestionsObtained() m_suggestionsReply = 0; QJsonParseError err; - QJsonDocument json = QJsonDocument::fromJson(response); + QJsonDocument json = QJsonDocument::fromJson(response, &err); const QVariant res = json.toVariant(); if (err.error != QJsonParseError::NoError || res.type() != QVariant::List) diff --git a/src/plugins/GreaseMonkey/gm_urlinterceptor.cpp b/src/plugins/GreaseMonkey/gm_urlinterceptor.cpp index 3653ba471..81858a8a1 100644 --- a/src/plugins/GreaseMonkey/gm_urlinterceptor.cpp +++ b/src/plugins/GreaseMonkey/gm_urlinterceptor.cpp @@ -34,4 +34,3 @@ void GM_UrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) info.block(true); } } - diff --git a/src/plugins/MouseGestures/3rdparty/adv_recognizer.cpp b/src/plugins/MouseGestures/3rdparty/adv_recognizer.cpp index c5240be5e..3db9b0465 100644 --- a/src/plugins/MouseGestures/3rdparty/adv_recognizer.cpp +++ b/src/plugins/MouseGestures/3rdparty/adv_recognizer.cpp @@ -160,7 +160,7 @@ void RealTimeMouseGestureRecognizer::recognizeGesture() directions.setReadPointerTo(readIndex); } } - catch (const std::exception &e) { + catch (const std::exception &) { directions.setReadPointerTo(readIndex); } }