diff --git a/src/Gui/ExportMenu.cpp b/src/Gui/ExportMenu.cpp --- a/src/Gui/ExportMenu.cpp +++ b/src/Gui/ExportMenu.cpp @@ -84,7 +84,7 @@ QString name = service->name().replace(QLatin1Char('&'), QLatin1String("&&")); QAction *action = new QAction(QIcon::fromTheme(service->icon()), name, this); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, this, [=]() { const QUrl filename = mExportManager->getAutosaveFilename(); mExportManager->doSave(filename); QList whereIs({ filename }); @@ -102,7 +102,7 @@ openWith->setText(i18n("Other Application...")); openWith->setShortcuts(KStandardShortcut::open()); - connect(openWith, &QAction::triggered, [=]() { + connect(openWith, &QAction::triggered, this, [=]() { const QUrl filename = mExportManager->getAutosaveFilename(); mExportManager->doSave(filename); QList whereIs({ filename }); diff --git a/src/Gui/KSMainWindow.cpp b/src/Gui/KSMainWindow.cpp --- a/src/Gui/KSMainWindow.cpp +++ b/src/Gui/KSMainWindow.cpp @@ -174,7 +174,7 @@ mToolsMenu->addAction(KStandardAction::print(this, &KSMainWindow::showPrintDialog, this)); mScreenRecorderToolsMenu = mToolsMenu->addMenu(i18n("Record Screen")); mScreenRecorderToolsMenu->setIcon(QIcon::fromTheme(QStringLiteral("media-record"))); - connect(mScreenRecorderToolsMenu, &QMenu::aboutToShow, [this]() + connect(mScreenRecorderToolsMenu, &QMenu::aboutToShow, this, [this]() { KMoreToolsMenuFactory *moreToolsMenuFactory = new KMoreToolsMenuFactory(QStringLiteral("spectacle/screenrecorder-tools")); moreToolsMenuFactory->setParentWidget(this); diff --git a/src/Gui/KSWidget.cpp b/src/Gui/KSWidget.cpp --- a/src/Gui/KSWidget.cpp +++ b/src/Gui/KSWidget.cpp @@ -130,7 +130,7 @@ connect(mTakeScreenshotButton, &QPushButton::clicked, this, &KSWidget::newScreenshotClicked); QShortcut *takeScreenshotShortcut = new QShortcut(QKeySequence(QKeySequence::New), mTakeScreenshotButton); - connect(takeScreenshotShortcut, &QShortcut::activated, [this]() { + connect(takeScreenshotShortcut, &QShortcut::activated, this, [this]() { mTakeScreenshotButton->animateClick(100); }); diff --git a/src/Gui/SettingsDialog/SaveOptionsPage.cpp b/src/Gui/SettingsDialog/SaveOptionsPage.cpp --- a/src/Gui/SettingsDialog/SaveOptionsPage.cpp +++ b/src/Gui/SettingsDialog/SaveOptionsPage.cpp @@ -71,7 +71,7 @@ mQualitySlider->setSliderPosition(SpectacleConfig::instance()->compressionQuality()); mQualitySlider->setTickPosition(QSlider::TicksBelow); mQualitySlider->setTracking(true); - connect(mQualitySlider, &QSlider::valueChanged, [=](int value) { + connect(mQualitySlider, &QSlider::valueChanged, this, [=](int value) { qualityValue->setNum(value); markDirty(); }); @@ -94,7 +94,7 @@ QHBoxLayout *saveFieldLayout = new QHBoxLayout; mSaveNameFormat = new QLineEdit; connect(mSaveNameFormat, &QLineEdit::textEdited, this, &SaveOptionsPage::markDirty); - connect(mSaveNameFormat, &QLineEdit::textEdited, [&](const QString &newText) { + connect(mSaveNameFormat, &QLineEdit::textEdited, this, [&](const QString &newText) { QString fmt; Q_FOREACH(auto item, QImageWriter::supportedImageFormats()) { fmt = QString::fromLocal8Bit(item); @@ -141,7 +141,7 @@ fmtHelpText->setWordWrap(true); fmtHelpText->setTextFormat(Qt::RichText); fmtHelpText->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); - connect(fmtHelpText, &QLabel::linkActivated, [this](const QString& placeholder) { + connect(fmtHelpText, &QLabel::linkActivated, this, [this](const QString& placeholder) { mSaveNameFormat->insert(placeholder); }); mainLayout->addWidget(fmtHelpText); diff --git a/src/Main.cpp b/src/Main.cpp --- a/src/Main.cpp +++ b/src/Main.cpp @@ -151,7 +151,7 @@ new KDBusService(KDBusService::Multiple, &lCore); SpectacleDBusAdapter *lDBusAdapter = new SpectacleDBusAdapter(&lCore); QObject::connect(&lCore, &SpectacleCore::grabFailed, lDBusAdapter, &SpectacleDBusAdapter::ScreenshotFailed); - QObject::connect(ExportManager::instance(), &ExportManager::imageSaved, [&](const QUrl &savedAt) { + QObject::connect(ExportManager::instance(), &ExportManager::imageSaved, lCore, [&](const QUrl &savedAt) { emit lDBusAdapter->ScreenshotTaken(savedAt.toLocalFile()); }); QDBusConnection::sessionBus().registerObject(QStringLiteral("/"), &lCore); diff --git a/src/SpectacleCore.cpp b/src/SpectacleCore.cpp --- a/src/SpectacleCore.cpp +++ b/src/SpectacleCore.cpp @@ -98,7 +98,7 @@ auto lIncludePointer = lGuiConfig.readEntry("includePointer", true); auto lIncludeDecorations = lGuiConfig.readEntry("includeDecorations", true); const Platform::GrabMode lCaptureMode = toPlatformGrabMode(theCaptureMode); - QTimer::singleShot(lMsec, [ this, lCaptureMode, lShutterMode, lIncludePointer, lIncludeDecorations ]() { + QTimer::singleShot(lMsec, this, [ this, lCaptureMode, lShutterMode, lIncludePointer, lIncludeDecorations ]() { mPlatform->doGrab(lShutterMode, lCaptureMode, lIncludePointer, lIncludeDecorations); }); } @@ -161,7 +161,7 @@ case Actions::TakeNewScreenshot: { auto lShutterMode = mPlatform->supportedShutterModes().testFlag(Platform::ShutterMode::Immediate) ? Platform::ShutterMode::Immediate : Platform::ShutterMode::OnClick; auto lGrabMode = toPlatformGrabMode(ExportManager::instance()->captureMode()); - QTimer::singleShot(KWindowSystem::compositingActive() ? 200 : 50, [this, lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations]() { + QTimer::singleShot(KWindowSystem::compositingActive() ? 200 : 50, this, [this, lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations]() { mPlatform->doGrab(lShutterMode, lGrabMode, lIncludePointer, lIncludeDecorations); }); break; @@ -201,7 +201,7 @@ // milliseconds is a good amount of wait time. auto lMsec = KWindowSystem::compositingActive() ? 200 : 50; - QTimer::singleShot(theTimeout + lMsec, [this, lGrabMode, theIncludePointer, theIncludeDecorations]() { + QTimer::singleShot(theTimeout + lMsec, this, [this, lGrabMode, theIncludePointer, theIncludeDecorations]() { mPlatform->doGrab(Platform::ShutterMode::Immediate, lGrabMode, theIncludePointer, theIncludeDecorations); }); } @@ -398,7 +398,7 @@ auto lShutterMode = mPlatform->supportedShutterModes().testFlag(Platform::ShutterMode::Immediate) ? Platform::ShutterMode::Immediate : Platform::ShutterMode::OnClick; auto lGrabMode = toPlatformGrabMode(ExportManager::instance()->captureMode()); - QTimer::singleShot(0, [this, lShutterMode, lGrabMode, theIncludePointer, theIncludeDecorations]() { + QTimer::singleShot(0, this, [this, lShutterMode, lGrabMode, theIncludePointer, theIncludeDecorations]() { mPlatform->doGrab(lShutterMode, lGrabMode, theIncludePointer, theIncludeDecorations); }); }