From 36a59518e977f19f5e97664f5648971162abcc75 Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 16 Apr 2021 10:59:18 +0200 Subject: [PATCH] Fix clazy connect-3arg-lambda --- ScreenPlay/app.cpp | 2 +- ScreenPlay/src/installedlistmodel.cpp | 3 +-- ScreenPlay/src/screenplaywallpaper.cpp | 2 +- ScreenPlaySDK/src/screenplaysdk.cpp | 2 +- ScreenPlayWallpaper/src/SPWmainwindow.cpp | 2 +- ScreenPlayWallpaper/src/winwindow.cpp | 4 ++-- ScreenPlayWidget/src/widgetwindow.cpp | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ScreenPlay/app.cpp b/ScreenPlay/app.cpp index 54eb637f..58ac9123 100644 --- a/ScreenPlay/app.cpp +++ b/ScreenPlay/app.cpp @@ -225,7 +225,7 @@ void App::exit() // Workaround because we cannot force to send exit event m_telemetry->setSendInterval(5); m_telemetry->endSession(); - QTimer::singleShot(150, []() { QApplication::instance()->quit(); }); + QTimer::singleShot(150, this, []() { QApplication::instance()->quit(); }); } } diff --git a/ScreenPlay/src/installedlistmodel.cpp b/ScreenPlay/src/installedlistmodel.cpp index 49fe4df8..3b541e85 100644 --- a/ScreenPlay/src/installedlistmodel.cpp +++ b/ScreenPlay/src/installedlistmodel.cpp @@ -33,7 +33,7 @@ void InstalledListModel::init() } auto reloadLambda = [this]() { - QTimer::singleShot(500, [this]() { + QTimer::singleShot(500, this, [this]() { reset(); }); }; @@ -170,7 +170,6 @@ void InstalledListModel::loadInstalledContent() if (!obj->contains("type")) continue; - if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString())) { if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString(), Qt::CaseInsensitive)) { append(*obj, item.baseName(), item.lastModified()); diff --git a/ScreenPlay/src/screenplaywallpaper.cpp b/ScreenPlay/src/screenplaywallpaper.cpp index 152b911f..6e9a4d54 100644 --- a/ScreenPlay/src/screenplaywallpaper.cpp +++ b/ScreenPlay/src/screenplaywallpaper.cpp @@ -187,7 +187,7 @@ void ScreenPlayWallpaper::setSDKConnection(const std::shared_ptr& { m_connection = connection; - QTimer::singleShot(1000, [this]() { + QTimer::singleShot(1000, this, [this]() { if (playbackRate() != 1.0) { setWallpaperValue("playbackRate", QString::number(playbackRate()), false); } diff --git a/ScreenPlaySDK/src/screenplaysdk.cpp b/ScreenPlaySDK/src/screenplaysdk.cpp index 9fa7ad1b..e3ee9025 100644 --- a/ScreenPlaySDK/src/screenplaysdk.cpp +++ b/ScreenPlaySDK/src/screenplaysdk.cpp @@ -36,7 +36,7 @@ void ScreenPlaySDK::init() // If the wallpaper never connects it will never get the // disconnect event. We can savely assume no connection will // be made after 1 second timeout. - QTimer::singleShot(1000, [this]() { + QTimer::singleShot(1000, this, [this]() { if (m_socket.state() != QLocalSocket::ConnectedState) { m_socket.disconnectFromServer(); emit sdkDisconnected(); diff --git a/ScreenPlayWallpaper/src/SPWmainwindow.cpp b/ScreenPlayWallpaper/src/SPWmainwindow.cpp index 23f44d35..92b7cc0a 100644 --- a/ScreenPlayWallpaper/src/SPWmainwindow.cpp +++ b/ScreenPlayWallpaper/src/SPWmainwindow.cpp @@ -158,7 +158,7 @@ MainWindow::MainWindow(int screenAt, QString projectPath, QString id, QString de } }); - QTimer::singleShot(3000, [=]() { + QTimer::singleShot(3000, this, [=]() { ShowWindow(m_hwnd, SW_SHOWNOACTIVATE); }); diff --git a/ScreenPlayWallpaper/src/winwindow.cpp b/ScreenPlayWallpaper/src/winwindow.cpp index 54ed0177..43651a03 100644 --- a/ScreenPlayWallpaper/src/winwindow.cpp +++ b/ScreenPlayWallpaper/src/winwindow.cpp @@ -99,7 +99,7 @@ LRESULT __stdcall MouseHookCallback(int nCode, WPARAM wParam, LPARAM lParam) if (type == QMouseEvent::Type::MouseButtonPress) { } - QTimer::singleShot(100, [&]() { + QTimer::singleShot(100, [&]() { //auto eventPress = QMouseEvent(QMouseEvent::Type::MouseButtonPress, g_LastMousePosition, mouseButton, mouseButtons, {}); //qInfo() << mouseButton << QApplication::sendEvent(g_winGlobalHook, &eventPress) << g_globalOffset.x() << g_globalOffset.y(); auto eventRelease = QMouseEvent(QMouseEvent::Type::MouseButtonRelease, g_LastMousePosition, mouseButton, mouseButtons, {}); @@ -189,7 +189,7 @@ WinWindow::WinWindow( } } - QTimer::singleShot(1000, [&]() { + QTimer::singleShot(1000, this, [&]() { setupWindowMouseHook(); }); } diff --git a/ScreenPlayWidget/src/widgetwindow.cpp b/ScreenPlayWidget/src/widgetwindow.cpp index 0b73ba00..3ff7675e 100644 --- a/ScreenPlayWidget/src/widgetwindow.cpp +++ b/ScreenPlayWidget/src/widgetwindow.cpp @@ -69,7 +69,7 @@ WidgetWindow::WidgetWindow( m_window.show(); // Do not trigger position changed save reuqest on startup - QTimer::singleShot(1000, [=, this]() { + QTimer::singleShot(1000, this, [=, this]() { // We limit ourself to only update the position every 500ms! auto sendPositionUpdate = [this]() { m_positionMessageLimiter.stop();