1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Misc fixes

Correctly initialize QJsonParserError
This commit is contained in:
David Rosca 2016-03-30 11:51:55 +02:00
parent dfa04388c7
commit a66e179b40
5 changed files with 4 additions and 6 deletions

View File

@ -216,7 +216,6 @@ void BrowserWindow::postLaunch()
if (m_startPage) { if (m_startPage) {
addTab = false; addTab = false;
m_tabWidget->addView(QUrl()); m_tabWidget->addView(QUrl());
weView()->page()->deleteLater();
weView()->setPage(m_startPage); weView()->setPage(m_startPage);
} }

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - WebKit based browser
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -67,7 +67,7 @@ BookmarkItem* ChromeImporter::importBookmarks()
m_file.close(); m_file.close();
QJsonParseError err; QJsonParseError err;
QJsonDocument json = QJsonDocument::fromJson(data); QJsonDocument json = QJsonDocument::fromJson(data, &err);
const QVariant res = json.toVariant(); const QVariant res = json.toVariant();
if (err.error != QJsonParseError::NoError || res.type() != QVariant::Map) { if (err.error != QJsonParseError::NoError || res.type() != QVariant::Map) {

View File

@ -632,7 +632,7 @@ void OpenSearchEngine::suggestionsObtained()
m_suggestionsReply = 0; m_suggestionsReply = 0;
QJsonParseError err; QJsonParseError err;
QJsonDocument json = QJsonDocument::fromJson(response); QJsonDocument json = QJsonDocument::fromJson(response, &err);
const QVariant res = json.toVariant(); const QVariant res = json.toVariant();
if (err.error != QJsonParseError::NoError || res.type() != QVariant::List) if (err.error != QJsonParseError::NoError || res.type() != QVariant::List)

View File

@ -34,4 +34,3 @@ void GM_UrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
info.block(true); info.block(true);
} }
} }

View File

@ -160,7 +160,7 @@ void RealTimeMouseGestureRecognizer::recognizeGesture()
directions.setReadPointerTo(readIndex); directions.setReadPointerTo(readIndex);
} }
} }
catch (const std::exception &e) { catch (const std::exception &) {
directions.setReadPointerTo(readIndex); directions.setReadPointerTo(readIndex);
} }
} }