diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-05-26 22:23:25 +0300 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-05-28 19:43:45 +0300 |
commit | 9c4dd932c6d692178bb8d5265c634126cb415767 (patch) | |
tree | 527300f8e710859965c142aed4e779a16b9d4ab6 /src/webengine | |
parent | Update ProfileEditor plugin (diff) | |
download | smolbote-9c4dd932c6d692178bb8d5265c634126cb415767.tar.xz |
Turn on more warnings by default
- fix clazy warnings
- fix various other compiler warnings
- bugfix: connect profiles' downloadRequested signal
Diffstat (limited to 'src/webengine')
-rw-r--r-- | src/webengine/webpage.cpp | 4 | ||||
-rw-r--r-- | src/webengine/webprofile.h | 2 | ||||
-rw-r--r-- | src/webengine/webview.cpp | 10 | ||||
-rw-r--r-- | src/webengine/webview.h | 2 | ||||
-rw-r--r-- | src/webengine/webviewcontextmenu.cpp | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/webengine/webpage.cpp b/src/webengine/webpage.cpp index 8c6b8db..b2b19b5 100644 --- a/src/webengine/webpage.cpp +++ b/src/webengine/webpage.cpp @@ -13,7 +13,7 @@ #include <QWebEngineFullScreenRequest> #include <QWebEngineCertificateError> -QString tr_terminationStatus(QWebEnginePage::RenderProcessTerminationStatus status) +[[nodiscard]] inline QString tr_terminationStatus(QWebEnginePage::RenderProcessTerminationStatus status) { switch(status) { case QWebEnginePage::NormalTerminationStatus: @@ -29,7 +29,7 @@ QString tr_terminationStatus(QWebEnginePage::RenderProcessTerminationStatus stat return QObject::tr("The render process was terminated with an unknown status."); } -QString feature_toString(QWebEnginePage::Feature feature) +[[nodiscard]] inline QString feature_toString(QWebEnginePage::Feature feature) { switch(feature) { case QWebEnginePage::Notifications: diff --git a/src/webengine/webprofile.h b/src/webengine/webprofile.h index 0747638..894463f 100644 --- a/src/webengine/webprofile.h +++ b/src/webengine/webprofile.h @@ -205,7 +205,7 @@ public slots: auto *store = cookieStore(); store->deleteAllCookies(); for(const auto &data : cookies) { - for(const auto &cookie : QNetworkCookie::parseCookies(data.toByteArray())) { + for(auto &cookie : QNetworkCookie::parseCookies(data.toByteArray())) { store->setCookie(cookie); } } diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index 135f25c..38e564a 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -42,21 +42,21 @@ WebView::WebView(WebProfile *profile, cb_createWindow_t cb, QWidget *parent) setPage(new WebPage(profile, this)); } -WebView::WebView(const Session::WebView &data, cb_createWindow_t cb, QWidget *parent) +WebView::WebView(const Session::WebView &webview_data, cb_createWindow_t cb, QWidget *parent) : WebView(parent) { cb_createWindow = cb; WebProfileManager profileManager; - auto *profile = profileManager.profile(data.profile); + auto *profile = profileManager.profile(webview_data.profile); if(profile != nullptr) { setProfile(profile); } - if(!data.url.isEmpty()) - load(QUrl::fromUserInput(data.url)); + if(!webview_data.url.isEmpty()) + load(QUrl::fromUserInput(webview_data.url)); else { - QByteArray copy(data.history); + QByteArray copy(webview_data.history); QDataStream historyStream(©, QIODevice::ReadOnly); historyStream >> *history(); } diff --git a/src/webengine/webview.h b/src/webengine/webview.h index a9c6866..34c77bf 100644 --- a/src/webengine/webview.h +++ b/src/webengine/webview.h @@ -28,7 +28,7 @@ public: typedef std::function<WebView *(QWebEnginePage::WebWindowType)> cb_createWindow_t; WebView(WebProfile *profile, cb_createWindow_t cb, QWidget *parent = nullptr); - WebView(const Session::WebView &data, cb_createWindow_t cb, QWidget *parent = nullptr); + WebView(const Session::WebView &webview_data, cb_createWindow_t cb, QWidget *parent = nullptr); ~WebView() = default; [[nodiscard]] WebProfile *profile() const diff --git a/src/webengine/webviewcontextmenu.cpp b/src/webengine/webviewcontextmenu.cpp index 1f6b337..ea5e8c6 100644 --- a/src/webengine/webviewcontextmenu.cpp +++ b/src/webengine/webviewcontextmenu.cpp @@ -196,7 +196,7 @@ WebViewContextMenu::WebViewContextMenu(WebView *view) auto *zoomSlider = new QSlider(Qt::Horizontal); zoomSlider->setMinimum(5); zoomSlider->setMaximum(50); - zoomSlider->setValue(view->zoomFactor() * 10); + zoomSlider->setValue(static_cast<int>(view->zoomFactor() * 10)); auto *zoomAction = this->addAction(tr("Zoom: %1x").arg(view->zoomFactor())); connect(zoomAction, &QAction::triggered, view, [zoomSlider]() { |