From 253ff428a70d6f873753e26de5cb27ab5d4d533a Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Tue, 1 Jan 2019 22:48:53 +0200 Subject: [PATCH] [effects] Port to new connect syntax Summary: The new connect syntax has several advantages over the old syntax: (a) Connecting with the new syntax is faster; (b) It is compile time checked. There are still a few places where the old connect syntax is used, e.g. connecting to QML buttons in the Desktop Grid effect. Test Plan: Have been testing this patch for ~2 weeks, haven't noticed any regressions. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: davidedmundson, broulik, graesslin, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D18368 --- effects/backgroundcontrast/contrast.cpp | 8 ++++---- effects/blur/blur.cpp | 8 ++++---- effects/coverswitch/coverswitch.cpp | 10 +++++----- effects/cube/cube.cpp | 16 ++++++++-------- effects/cube/cube_config.cpp | 2 +- effects/desktopgrid/desktopgrid.cpp | 16 ++++++++-------- effects/desktopgrid/desktopgrid_config.cpp | 6 +++--- effects/fallapart/fallapart.cpp | 6 +++--- effects/flipswitch/flipswitch.cpp | 16 ++++++++-------- effects/highlightwindow/highlightwindow.cpp | 12 ++++++++---- effects/invert/invert.cpp | 6 +++--- effects/invert/invert_config.cpp | 2 +- effects/kscreen/kscreen.cpp | 2 +- effects/lookingglass/lookingglass.cpp | 4 ++-- effects/lookingglass/lookingglass_config.cpp | 2 +- effects/magiclamp/magiclamp.cpp | 6 +++--- effects/magnifier/magnifier.cpp | 4 ++-- effects/magnifier/magnifier_config.cpp | 2 +- effects/mouseclick/mouseclick.cpp | 8 +++----- effects/mouseclick/mouseclick_config.cpp | 2 +- effects/mousemark/mousemark.cpp | 9 ++++----- effects/presentwindows/presentwindows.cpp | 16 ++++++++-------- .../presentwindows/presentwindows_config.cpp | 2 +- effects/resize/resize.cpp | 6 +++--- effects/screenedge/screenedgeeffect.cpp | 4 ++-- effects/screenshot/screenshot.cpp | 2 +- effects/slideback/slideback.cpp | 12 ++++++------ effects/startupfeedback/startupfeedback.cpp | 9 ++++----- effects/thumbnailaside/thumbnailaside.cpp | 10 +++++----- .../thumbnailaside/thumbnailaside_config.cpp | 2 +- effects/trackmouse/trackmouse.cpp | 5 ++--- effects/trackmouse/trackmouse_config.cpp | 4 ++-- effects/windowgeometry/windowgeometry.cpp | 8 ++++---- .../windowgeometry/windowgeometry_config.cpp | 2 +- effects/wobblywindows/wobblywindows.cpp | 13 ++++++------- effects/wobblywindows/wobblywindows_config.cpp | 2 +- effects/zoom/zoom.cpp | 17 ++++++++--------- effects/zoom/zoom_config.cpp | 2 +- 38 files changed, 130 insertions(+), 133 deletions(-) diff --git a/effects/backgroundcontrast/contrast.cpp b/effects/backgroundcontrast/contrast.cpp index 3705a64d13..a6fbfa57df 100644 --- a/effects/backgroundcontrast/contrast.cpp +++ b/effects/backgroundcontrast/contrast.cpp @@ -54,10 +54,10 @@ ContrastEffect::ContrastEffect() net_wm_contrast_region = 0; } - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); - connect(effects, SIGNAL(screenGeometryChanged(QSize)), this, SLOT(slotScreenGeometryChanged())); + connect(effects, &EffectsHandler::windowAdded, this, &ContrastEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowDeleted, this, &ContrastEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::propertyNotify, this, &ContrastEffect::slotPropertyNotify); + connect(effects, &EffectsHandler::screenGeometryChanged, this, &ContrastEffect::slotScreenGeometryChanged); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this] { if (shader && shader->isValid()) { diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index be4d4fa20e..c0e771dc05 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -64,10 +64,10 @@ BlurEffect::BlurEffect() net_wm_blur_region = 0; } - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); - connect(effects, SIGNAL(screenGeometryChanged(QSize)), this, SLOT(slotScreenGeometryChanged())); + connect(effects, &EffectsHandler::windowAdded, this, &BlurEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowDeleted, this, &BlurEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::propertyNotify, this, &BlurEffect::slotPropertyNotify); + connect(effects, &EffectsHandler::screenGeometryChanged, this, &BlurEffect::slotScreenGeometryChanged); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this] { if (m_shader && m_shader->isValid() && m_renderTargetsValid) { diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 4d1074dc30..29b7009c46 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -67,11 +67,11 @@ CoverSwitchEffect::CoverSwitchEffect() } else { m_reflectionShader = NULL; } - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(tabBoxAdded(int)), this, SLOT(slotTabBoxAdded(int))); - connect(effects, SIGNAL(tabBoxClosed()), this, SLOT(slotTabBoxClosed())); - connect(effects, SIGNAL(tabBoxUpdated()), this, SLOT(slotTabBoxUpdated())); - connect(effects, SIGNAL(tabBoxKeyEvent(QKeyEvent*)), this, SLOT(slotTabBoxKeyEvent(QKeyEvent*))); + connect(effects, &EffectsHandler::windowClosed, this, &CoverSwitchEffect::slotWindowClosed); + connect(effects, &EffectsHandler::tabBoxAdded, this, &CoverSwitchEffect::slotTabBoxAdded); + connect(effects, &EffectsHandler::tabBoxClosed, this, &CoverSwitchEffect::slotTabBoxClosed); + connect(effects, &EffectsHandler::tabBoxUpdated, this, &CoverSwitchEffect::slotTabBoxUpdated); + connect(effects, &EffectsHandler::tabBoxKeyEvent, this, &CoverSwitchEffect::slotTabBoxKeyEvent); } CoverSwitchEffect::~CoverSwitchEffect() diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 64c622d9bc..1208f2e39d 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -98,9 +98,9 @@ CubeEffect::CubeEffect() } m_textureMirrorMatrix.scale(1.0, -1.0, 1.0); m_textureMirrorMatrix.translate(0.0, -1.0, 0.0); - connect(effects, SIGNAL(tabBoxAdded(int)), this, SLOT(slotTabBoxAdded(int))); - connect(effects, SIGNAL(tabBoxClosed()), this, SLOT(slotTabBoxClosed())); - connect(effects, SIGNAL(tabBoxUpdated()), this, SLOT(slotTabBoxUpdated())); + connect(effects, &EffectsHandler::tabBoxAdded, this, &CubeEffect::slotTabBoxAdded); + connect(effects, &EffectsHandler::tabBoxClosed, this, &CubeEffect::slotTabBoxClosed); + connect(effects, &EffectsHandler::tabBoxUpdated, this, &CubeEffect::slotTabBoxUpdated); reconfigure(ReconfigureAll); } @@ -202,9 +202,9 @@ void CubeEffect::reconfigure(ReconfigureFlags) KGlobalAccel::self()->setShortcut(sphereAction, QList()); sphereShortcut = KGlobalAccel::self()->shortcut(sphereAction); effects->registerGlobalShortcut(QKeySequence(), sphereAction); - connect(cubeAction, SIGNAL(triggered(bool)), this, SLOT(toggleCube())); - connect(cylinderAction, SIGNAL(triggered(bool)), this, SLOT(toggleCylinder())); - connect(sphereAction, SIGNAL(triggered(bool)), this, SLOT(toggleSphere())); + connect(cubeAction, &QAction::triggered, this, &CubeEffect::toggleCube); + connect(cylinderAction, &QAction::triggered, this, &CubeEffect::toggleCylinder); + connect(sphereAction, &QAction::triggered, this, &CubeEffect::toggleSphere); connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &CubeEffect::globalShortcutChanged); shortcutsRegistered = true; } @@ -1537,13 +1537,13 @@ void CubeEffect::setActive(bool active) QString capPath = CubeConfig::capPath(); if (texturedCaps && !capTexture && !capPath.isEmpty()) { QFutureWatcher *watcher = new QFutureWatcher(this); - connect(watcher, SIGNAL(finished()), SLOT(slotCubeCapLoaded())); + connect(watcher, &QFutureWatcher::finished, this, &CubeEffect::slotCubeCapLoaded); watcher->setFuture(QtConcurrent::run(this, &CubeEffect::loadCubeCap, capPath)); } QString wallpaperPath = CubeConfig::wallpaper().toLocalFile(); if (!wallpaper && !wallpaperPath.isEmpty()) { QFutureWatcher *watcher = new QFutureWatcher(this); - connect(watcher, SIGNAL(finished()), SLOT(slotWallPaperLoaded())); + connect(watcher, &QFutureWatcher::finished, this, &CubeEffect::slotWallPaperLoaded); watcher->setFuture(QtConcurrent::run(this, &CubeEffect::loadWallPaper, wallpaperPath)); } activated = true; diff --git a/effects/cube/cube_config.cpp b/effects/cube/cube_config.cpp index 422506dd92..0c663c555f 100644 --- a/effects/cube/cube_config.cpp +++ b/effects/cube/cube_config.cpp @@ -84,7 +84,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) : m_ui->editor->addCollection(m_actionCollection); capsSelectionChanged(); - connect(m_ui->kcfg_Caps, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged())); + connect(m_ui->kcfg_Caps, &QCheckBox::stateChanged, this, &CubeEffectConfig::capsSelectionChanged); m_ui->kcfg_Wallpaper->setFilter(QStringLiteral("*.png *.jpeg *.jpg ")); CubeConfig::instance(KWIN_CONFIG); addConfig(CubeConfig::self(), m_ui); diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index d920bea931..e7eb3b997e 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -79,13 +79,13 @@ DesktopGridEffect::DesktopGridEffect() shortcut = KGlobalAccel::self()->shortcut(a); effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F8, a); effects->registerTouchpadSwipeShortcut(SwipeDirection::Up, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle())); + connect(a, &QAction::triggered, this, &DesktopGridEffect::toggle); connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &DesktopGridEffect::globalShortcutChanged); - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(numberDesktopsChanged(uint)), this, SLOT(slotNumberDesktopsChanged(uint))); - connect(effects, SIGNAL(windowGeometryShapeChanged(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowGeometryShapeChanged(KWin::EffectWindow*,QRect))); + connect(effects, &EffectsHandler::windowAdded, this, &DesktopGridEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowClosed, this, &DesktopGridEffect::slotWindowClosed); + connect(effects, &EffectsHandler::windowDeleted, this, &DesktopGridEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::numberDesktopsChanged, this, &DesktopGridEffect::slotNumberDesktopsChanged); + connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &DesktopGridEffect::slotWindowGeometryShapeChanged); connect(effects, &EffectsHandler::numberScreensChanged, this, &DesktopGridEffect::setup); // Load all other configuration details @@ -1128,8 +1128,8 @@ void DesktopGridEffect::setup() view = new DesktopButtonsView(); m_desktopButtonsViews.append(view); it = m_desktopButtonsViews.end(); // changed through insert! - connect(view, SIGNAL(addDesktop()), SLOT(slotAddDesktop())); - connect(view, SIGNAL(removeDesktop()), SLOT(slotRemoveDesktop())); + connect(view, &DesktopButtonsView::addDesktop, this, &DesktopGridEffect::slotAddDesktop); + connect(view, &DesktopButtonsView::removeDesktop, this, &DesktopGridEffect::slotRemoveDesktop); } else { view = *it; ++it; diff --git a/effects/desktopgrid/desktopgrid_config.cpp b/effects/desktopgrid/desktopgrid_config.cpp index 3b175359ef..2d8e917a97 100644 --- a/effects/desktopgrid/desktopgrid_config.cpp +++ b/effects/desktopgrid/desktopgrid_config.cpp @@ -86,9 +86,9 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant DesktopGridConfig::instance(KWIN_CONFIG); addConfig(DesktopGridConfig::self(), m_ui); - connect(m_ui->kcfg_LayoutMode, SIGNAL(currentIndexChanged(int)), this, SLOT(layoutSelectionChanged())); - connect(m_ui->desktopNameAlignmentCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); - connect(m_ui->shortcutEditor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->kcfg_LayoutMode, qOverload(&KComboBox::currentIndexChanged), this, &DesktopGridEffectConfig::layoutSelectionChanged); + connect(m_ui->desktopNameAlignmentCombo, qOverload(&KComboBox::currentIndexChanged), this, qOverload<>(&DesktopGridEffectConfig::changed)); + connect(m_ui->shortcutEditor, &KShortcutsEditor::keyChange, this, qOverload<>(&DesktopGridEffectConfig::changed)); load(); layoutSelectionChanged(); diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp index 5d3f0997b9..d2dea06f75 100644 --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -36,9 +36,9 @@ FallApartEffect::FallApartEffect() { initConfig(); reconfigure(ReconfigureAll); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDataChanged(KWin::EffectWindow*,int)), this, SLOT(slotWindowDataChanged(KWin::EffectWindow*,int))); + connect(effects, &EffectsHandler::windowClosed, this, &FallApartEffect::slotWindowClosed); + connect(effects, &EffectsHandler::windowDeleted, this, &FallApartEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::windowDataChanged, this, &FallApartEffect::slotWindowDataChanged); } void FallApartEffect::reconfigure(ReconfigureFlags) diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp index c72b953e5b..890b6d881e 100644 --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -60,21 +60,21 @@ FlipSwitchEffect::FlipSwitchEffect() KGlobalAccel::self()->setShortcut(flipSwitchCurrentAction, QList()); m_shortcutCurrent = KGlobalAccel::self()->shortcut(flipSwitchCurrentAction); effects->registerGlobalShortcut(QKeySequence(), flipSwitchCurrentAction); - connect(flipSwitchCurrentAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveCurrent())); + connect(flipSwitchCurrentAction, &QAction::triggered, this, &FlipSwitchEffect::toggleActiveCurrent); QAction* flipSwitchAllAction = new QAction(this); flipSwitchAllAction->setObjectName(QStringLiteral("FlipSwitchAll")); flipSwitchAllAction->setText(i18n("Toggle Flip Switch (All desktops)")); KGlobalAccel::self()->setShortcut(flipSwitchAllAction, QList()); effects->registerGlobalShortcut(QKeySequence(), flipSwitchAllAction); m_shortcutAll = KGlobalAccel::self()->shortcut(flipSwitchAllAction); - connect(flipSwitchAllAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops())); + connect(flipSwitchAllAction, &QAction::triggered, this, &FlipSwitchEffect::toggleActiveAllDesktops); connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &FlipSwitchEffect::globalShortcutChanged); - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(tabBoxAdded(int)), this, SLOT(slotTabBoxAdded(int))); - connect(effects, SIGNAL(tabBoxClosed()), this, SLOT(slotTabBoxClosed())); - connect(effects, SIGNAL(tabBoxUpdated()), this, SLOT(slotTabBoxUpdated())); - connect(effects, SIGNAL(tabBoxKeyEvent(QKeyEvent*)), this, SLOT(slotTabBoxKeyEvent(QKeyEvent*))); + connect(effects, &EffectsHandler::windowAdded, this, &FlipSwitchEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowClosed, this, &FlipSwitchEffect::slotWindowClosed); + connect(effects, &EffectsHandler::tabBoxAdded, this, &FlipSwitchEffect::slotTabBoxAdded); + connect(effects, &EffectsHandler::tabBoxClosed, this, &FlipSwitchEffect::slotTabBoxClosed); + connect(effects, &EffectsHandler::tabBoxUpdated, this, &FlipSwitchEffect::slotTabBoxUpdated); + connect(effects, &EffectsHandler::tabBoxKeyEvent, this, &FlipSwitchEffect::slotTabBoxKeyEvent); } FlipSwitchEffect::~FlipSwitchEffect() diff --git a/effects/highlightwindow/highlightwindow.cpp b/effects/highlightwindow/highlightwindow.cpp index 355220c89f..cd3ddd4a15 100644 --- a/effects/highlightwindow/highlightwindow.cpp +++ b/effects/highlightwindow/highlightwindow.cpp @@ -29,10 +29,14 @@ HighlightWindowEffect::HighlightWindowEffect() , m_monitorWindow(NULL) { m_atom = effects->announceSupportProperty("_KDE_WINDOW_HIGHLIGHT", this); - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); + connect(effects, &EffectsHandler::windowAdded, this, &HighlightWindowEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowClosed, this, &HighlightWindowEffect::slotWindowClosed); + connect(effects, &EffectsHandler::windowDeleted, this, &HighlightWindowEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::propertyNotify, this, + [this](EffectWindow *w, long atom) { + slotPropertyNotify(w, atom, nullptr); + } + ); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this] { m_atom = effects->announceSupportProperty("_KDE_WINDOW_HIGHLIGHT", this); diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index 58c32ca648..be1e1f6a32 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -46,7 +46,7 @@ InvertEffect::InvertEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_I, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleScreenInversion())); + connect(a, &QAction::triggered, this, &InvertEffect::toggleScreenInversion); QAction* b = new QAction(this); b->setObjectName(QStringLiteral("InvertWindow")); @@ -54,9 +54,9 @@ InvertEffect::InvertEffect() KGlobalAccel::self()->setDefaultShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); KGlobalAccel::self()->setShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_U, b); - connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleWindow())); + connect(b, &QAction::triggered, this, &InvertEffect::toggleWindow); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); + connect(effects, &EffectsHandler::windowClosed, this, &InvertEffect::slotWindowClosed); } InvertEffect::~InvertEffect() diff --git a/effects/invert/invert_config.cpp b/effects/invert/invert_config.cpp index 5888fb7305..01bd05051a 100644 --- a/effects/invert/invert_config.cpp +++ b/effects/invert/invert_config.cpp @@ -62,7 +62,7 @@ InvertEffectConfig::InvertEffectConfig(QWidget* parent, const QVariantList& args mShortcutEditor = new KShortcutsEditor(actionCollection, this, KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed); - connect(mShortcutEditor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(mShortcutEditor, &KShortcutsEditor::keyChange, this, qOverload<>(&InvertEffectConfig::changed)); layout->addWidget(mShortcutEditor); load(); diff --git a/effects/kscreen/kscreen.cpp b/effects/kscreen/kscreen.cpp index d377fabcfd..6c3ce844af 100644 --- a/effects/kscreen/kscreen.cpp +++ b/effects/kscreen/kscreen.cpp @@ -56,7 +56,7 @@ KscreenEffect::KscreenEffect() , m_atom(effects->announceSupportProperty("_KDE_KWIN_KSCREEN_SUPPORT", this)) { initConfig(); - connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), SLOT(propertyNotify(KWin::EffectWindow*,long))); + connect(effects, &EffectsHandler::propertyNotify, this, &KscreenEffect::propertyNotify); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this] { m_atom = effects->announceSupportProperty(QByteArrayLiteral("_KDE_KWIN_KSCREEN_SUPPORT"), this); diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index f275cd8e56..70ea704e74 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -69,8 +69,8 @@ LookingGlassEffect::LookingGlassEffect() KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + connect(effects, &EffectsHandler::mouseChanged, this, &LookingGlassEffect::slotMouseChanged); + reconfigure(ReconfigureAll); } diff --git a/effects/lookingglass/lookingglass_config.cpp b/effects/lookingglass/lookingglass_config.cpp index 7b2de554d6..494083dc47 100644 --- a/effects/lookingglass/lookingglass_config.cpp +++ b/effects/lookingglass/lookingglass_config.cpp @@ -61,7 +61,7 @@ LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVaria LookingGlassConfig::instance(KWIN_CONFIG); addConfig(LookingGlassConfig::self(), m_ui); - connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&LookingGlassEffectConfig::changed)); // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, QStringLiteral("kwin")); diff --git a/effects/magiclamp/magiclamp.cpp b/effects/magiclamp/magiclamp.cpp index e3821560da..76513b7105 100644 --- a/effects/magiclamp/magiclamp.cpp +++ b/effects/magiclamp/magiclamp.cpp @@ -31,9 +31,9 @@ MagicLampEffect::MagicLampEffect() { initConfig(); reconfigure(ReconfigureAll); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowMinimized(KWin::EffectWindow*)), this, SLOT(slotWindowMinimized(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowUnminimized(KWin::EffectWindow*)), this, SLOT(slotWindowUnminimized(KWin::EffectWindow*))); + connect(effects, &EffectsHandler::windowDeleted, this, &MagicLampEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::windowMinimized, this, &MagicLampEffect::slotWindowMinimized); + connect(effects, &EffectsHandler::windowUnminimized, this, &MagicLampEffect::slotWindowUnminimized); } bool MagicLampEffect::supported() diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 22aa7fb5d9..9a22b3806d 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -67,8 +67,8 @@ MagnifierEffect::MagnifierEffect() KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); effects->registerGlobalShortcut(Qt::META + Qt::Key_0, a); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + connect(effects, &EffectsHandler::mouseChanged, this, &MagnifierEffect::slotMouseChanged); + reconfigure(ReconfigureAll); } diff --git a/effects/magnifier/magnifier_config.cpp b/effects/magnifier/magnifier_config.cpp index 61f4ae9976..93dc8c13d1 100644 --- a/effects/magnifier/magnifier_config.cpp +++ b/effects/magnifier/magnifier_config.cpp @@ -61,7 +61,7 @@ MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList MagnifierConfig::instance(KWIN_CONFIG); addConfig(MagnifierConfig::self(), m_ui); - connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&MagnifierEffectConfig::changed)); // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, QStringLiteral("kwin")); diff --git a/effects/mouseclick/mouseclick.cpp b/effects/mouseclick/mouseclick.cpp index e15c46b030..4cf5788a40 100644 --- a/effects/mouseclick/mouseclick.cpp +++ b/effects/mouseclick/mouseclick.cpp @@ -52,7 +52,7 @@ MouseClickEffect::MouseClickEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Asterisk); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Asterisk); effects->registerGlobalShortcut(Qt::META + Qt::Key_Asterisk, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleEnabled())); + connect(a, &QAction::triggered, this, &MouseClickEffect::toggleEnabled); reconfigure(ReconfigureAll); @@ -227,12 +227,10 @@ void MouseClickEffect::toggleEnabled() m_enabled = !m_enabled; if (m_enabled) { - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + connect(effects, &EffectsHandler::mouseChanged, this, &MouseClickEffect::slotMouseChanged); effects->startMousePolling(); } else { - disconnect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + disconnect(effects, &EffectsHandler::mouseChanged, this, &MouseClickEffect::slotMouseChanged); effects->stopMousePolling(); } diff --git a/effects/mouseclick/mouseclick_config.cpp b/effects/mouseclick/mouseclick_config.cpp index ba516e25b8..014825f3b8 100644 --- a/effects/mouseclick/mouseclick_config.cpp +++ b/effects/mouseclick/mouseclick_config.cpp @@ -54,7 +54,7 @@ MouseClickEffectConfig::MouseClickEffectConfig(QWidget* parent, const QVariantLi QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(m_ui); - connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&MouseClickEffectConfig::changed)); // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, QStringLiteral("kwin")); diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp index 25ddc0f9ad..e969d16bf8 100644 --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -53,18 +53,17 @@ MouseMarkEffect::MouseMarkEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F11); KGlobalAccel::self()->setShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F11); effects->registerGlobalShortcut(Qt::SHIFT + Qt::META + Qt::Key_F11, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(clear())); + connect(a, &QAction::triggered, this, &MouseMarkEffect::clear); a = new QAction(this); a->setObjectName(QStringLiteral("ClearLastMouseMark")); a->setText(i18n("Clear Last Mouse Mark")); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F12); KGlobalAccel::self()->setShortcut(a, QList() << Qt::SHIFT + Qt::META + Qt::Key_F12); effects->registerGlobalShortcut(Qt::SHIFT + Qt::META + Qt::Key_F12, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(clearLast())); + connect(a, &QAction::triggered, this, &MouseMarkEffect::clearLast); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); - connect(effects, SIGNAL(screenLockingChanged(bool)), SLOT(screenLockingChanged(bool))); + connect(effects, &EffectsHandler::mouseChanged, this, &MouseMarkEffect::slotMouseChanged); + connect(effects, &EffectsHandler::screenLockingChanged, this, &MouseMarkEffect::screenLockingChanged); reconfigure(ReconfigureAll); arrow_start = NULL_POINT; effects->startMousePolling(); // We require it to detect activation as well diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 3a6bc6a46d..cfce07281a 100644 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -80,7 +80,7 @@ PresentWindowsEffect::PresentWindowsEffect() KGlobalAccel::self()->setShortcut(exposeAction, QList() << Qt::CTRL + Qt::Key_F9); shortcut = KGlobalAccel::self()->shortcut(exposeAction); effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F9, exposeAction); - connect(exposeAction, SIGNAL(triggered(bool)), this, SLOT(toggleActive())); + connect(exposeAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActive); QAction* exposeAllAction = m_exposeAllAction; exposeAllAction->setObjectName(QStringLiteral("ExposeAll")); exposeAllAction->setText(i18n("Toggle Present Windows (All desktops)")); @@ -89,22 +89,22 @@ PresentWindowsEffect::PresentWindowsEffect() shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction); effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction); effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, exposeAllAction); - connect(exposeAllAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops())); + connect(exposeAllAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveAllDesktops); QAction* exposeClassAction = m_exposeClassAction; exposeClassAction->setObjectName(QStringLiteral("ExposeClass")); exposeClassAction->setText(i18n("Toggle Present Windows (Window class)")); KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList() << Qt::CTRL + Qt::Key_F7); KGlobalAccel::self()->setShortcut(exposeClassAction, QList() << Qt::CTRL + Qt::Key_F7); effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F7, exposeClassAction); - connect(exposeClassAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveClass())); + connect(exposeClassAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveClass); shortcutClass = KGlobalAccel::self()->shortcut(exposeClassAction); connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &PresentWindowsEffect::globalShortcutChanged); reconfigure(ReconfigureAll); - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowGeometryShapeChanged(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowGeometryShapeChanged(KWin::EffectWindow*,QRect))); - connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); + connect(effects, &EffectsHandler::windowAdded, this, &PresentWindowsEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowClosed, this, &PresentWindowsEffect::slotWindowClosed); + connect(effects, &EffectsHandler::windowDeleted, this, &PresentWindowsEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &PresentWindowsEffect::slotWindowGeometryShapeChanged); + connect(effects, &EffectsHandler::propertyNotify, this, &PresentWindowsEffect::slotPropertyNotify); connect(effects, &EffectsHandler::numberScreensChanged, this, [this] { if (isActive()) diff --git a/effects/presentwindows/presentwindows_config.cpp b/effects/presentwindows/presentwindows_config.cpp index fe383765da..edb2af54f8 100644 --- a/effects/presentwindows/presentwindows_config.cpp +++ b/effects/presentwindows/presentwindows_config.cpp @@ -83,7 +83,7 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV m_ui->shortcutEditor->addCollection(m_actionCollection); - connect(m_ui->shortcutEditor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->shortcutEditor, &KShortcutsEditor::keyChange, this, qOverload<>(&PresentWindowsEffectConfig::changed)); PresentWindowsConfig::instance(KWIN_CONFIG); addConfig(PresentWindowsConfig::self(), m_ui); diff --git a/effects/resize/resize.cpp b/effects/resize/resize.cpp index e1035626d9..dd0028cd0b 100644 --- a/effects/resize/resize.cpp +++ b/effects/resize/resize.cpp @@ -42,9 +42,9 @@ ResizeEffect::ResizeEffect() { initConfig(); reconfigure(ReconfigureAll); - connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*,QRect))); - connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*))); + connect(effects, &EffectsHandler::windowStartUserMovedResized, this, &ResizeEffect::slotWindowStartUserMovedResized); + connect(effects, &EffectsHandler::windowStepUserMovedResized, this, &ResizeEffect::slotWindowStepUserMovedResized); + connect(effects, &EffectsHandler::windowFinishUserMovedResized, this, &ResizeEffect::slotWindowFinishUserMovedResized); } ResizeEffect::~ResizeEffect() diff --git a/effects/screenedge/screenedgeeffect.cpp b/effects/screenedge/screenedgeeffect.cpp index 1b8dea068c..481c3496a9 100644 --- a/effects/screenedge/screenedgeeffect.cpp +++ b/effects/screenedge/screenedgeeffect.cpp @@ -39,10 +39,10 @@ ScreenEdgeEffect::ScreenEdgeEffect() : Effect() , m_cleanupTimer(new QTimer(this)) { - connect(effects, SIGNAL(screenEdgeApproaching(ElectricBorder,qreal,QRect)), SLOT(edgeApproaching(ElectricBorder,qreal,QRect))); + connect(effects, &EffectsHandler::screenEdgeApproaching, this, &ScreenEdgeEffect::edgeApproaching); m_cleanupTimer->setInterval(5000); m_cleanupTimer->setSingleShot(true); - connect(m_cleanupTimer, SIGNAL(timeout()), SLOT(cleanup())); + connect(m_cleanupTimer, &QTimer::timeout, this, &ScreenEdgeEffect::cleanup); connect(effects, &EffectsHandler::screenLockingChanged, this, [this] (bool locked) { if (locked) { diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index 3139bd85dc..e35e1d84e1 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -60,7 +60,7 @@ bool ScreenShotEffect::supported() ScreenShotEffect::ScreenShotEffect() : m_scheduledScreenshot(0) { - connect ( effects, SIGNAL(windowClosed(KWin::EffectWindow*)), SLOT(windowClosed(KWin::EffectWindow*)) ); + connect(effects, &EffectsHandler::windowClosed, this, &ScreenShotEffect::windowClosed); QDBusConnection::sessionBus().registerObject(QStringLiteral("/Screenshot"), this, QDBusConnection::ExportScriptableContents); } diff --git a/effects/slideback/slideback.cpp b/effects/slideback/slideback.cpp index c0b7aa9468..46073645de 100644 --- a/effects/slideback/slideback.cpp +++ b/effects/slideback/slideback.cpp @@ -27,12 +27,12 @@ SlideBackEffect::SlideBackEffect() { m_tabboxActive = 0; m_justMapped = m_upmostWindow = NULL; - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), SLOT(slotWindowDeleted(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowUnminimized(KWin::EffectWindow*)), SLOT(slotWindowUnminimized(KWin::EffectWindow*))); - connect(effects, SIGNAL(tabBoxAdded(int)), SLOT(slotTabBoxAdded())); - connect(effects, SIGNAL(stackingOrderChanged()), SLOT(slotStackingOrderChanged())); - connect(effects, SIGNAL(tabBoxClosed()), SLOT(slotTabBoxClosed())); + connect(effects, &EffectsHandler::windowAdded, this, &SlideBackEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowDeleted, this, &SlideBackEffect::slotWindowDeleted); + connect(effects, &EffectsHandler::windowUnminimized, this, &SlideBackEffect::slotWindowUnminimized); + connect(effects, &EffectsHandler::tabBoxAdded, this, &SlideBackEffect::slotTabBoxAdded); + connect(effects, &EffectsHandler::stackingOrderChanged, this, &SlideBackEffect::slotStackingOrderChanged); + connect(effects, &EffectsHandler::tabBoxClosed, this, &SlideBackEffect::slotTabBoxClosed); } void SlideBackEffect::slotStackingOrderChanged() diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp index 08e1e2d7c3..01f0ae23df 100644 --- a/effects/startupfeedback/startupfeedback.cpp +++ b/effects/startupfeedback/startupfeedback.cpp @@ -90,11 +90,10 @@ StartupFeedbackEffect::StartupFeedbackEffect() m_selection = new KSelectionOwner("_KDE_STARTUP_FEEDBACK", xcbConnection(), x11RootWindow(), this); m_selection->claim(true); } - connect(m_startupInfo, SIGNAL(gotNewStartup(KStartupInfoId,KStartupInfoData)), SLOT(gotNewStartup(KStartupInfoId,KStartupInfoData))); - connect(m_startupInfo, SIGNAL(gotRemoveStartup(KStartupInfoId,KStartupInfoData)), SLOT(gotRemoveStartup(KStartupInfoId,KStartupInfoData))); - connect(m_startupInfo, SIGNAL(gotStartupChange(KStartupInfoId,KStartupInfoData)), SLOT(gotStartupChange(KStartupInfoId,KStartupInfoData))); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + connect(m_startupInfo, &KStartupInfo::gotNewStartup, this, &StartupFeedbackEffect::gotNewStartup); + connect(m_startupInfo, &KStartupInfo::gotRemoveStartup, this, &StartupFeedbackEffect::gotRemoveStartup); + connect(m_startupInfo, &KStartupInfo::gotStartupChange, this, &StartupFeedbackEffect::gotStartupChange); + connect(effects, &EffectsHandler::mouseChanged, this, &StartupFeedbackEffect::slotMouseChanged); reconfigure(ReconfigureAll); } diff --git a/effects/thumbnailaside/thumbnailaside.cpp b/effects/thumbnailaside/thumbnailaside.cpp index 2e58ea9b7c..c17269e44a 100644 --- a/effects/thumbnailaside/thumbnailaside.cpp +++ b/effects/thumbnailaside/thumbnailaside.cpp @@ -39,12 +39,12 @@ ThumbnailAsideEffect::ThumbnailAsideEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_T); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::CTRL + Qt::Key_T); effects->registerGlobalShortcut(Qt::META + Qt::CTRL + Qt::Key_T, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleCurrentThumbnail())); + connect(a, &QAction::triggered, this, &ThumbnailAsideEffect::toggleCurrentThumbnail); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowGeometryShapeChanged(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowGeometryShapeChanged(KWin::EffectWindow*,QRect))); - connect(effects, SIGNAL(windowDamaged(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowDamaged(KWin::EffectWindow*,QRect))); - connect(effects, SIGNAL(screenLockingChanged(bool)), SLOT(repaintAll())); + connect(effects, &EffectsHandler::windowClosed, this, &ThumbnailAsideEffect::slotWindowClosed); + connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &ThumbnailAsideEffect::slotWindowGeometryShapeChanged); + connect(effects, &EffectsHandler::windowDamaged, this, &ThumbnailAsideEffect::slotWindowDamaged); + connect(effects, &EffectsHandler::screenLockingChanged, this, &ThumbnailAsideEffect::repaintAll); reconfigure(ReconfigureAll); } diff --git a/effects/thumbnailaside/thumbnailaside_config.cpp b/effects/thumbnailaside/thumbnailaside_config.cpp index 89eccbebe4..453180b1b1 100644 --- a/effects/thumbnailaside/thumbnailaside_config.cpp +++ b/effects/thumbnailaside/thumbnailaside_config.cpp @@ -57,7 +57,7 @@ ThumbnailAsideEffectConfig::ThumbnailAsideEffectConfig(QWidget* parent, const QV layout->addWidget(m_ui); - connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&ThumbnailAsideEffectConfig::changed)); ThumbnailAsideConfig::instance(KWIN_CONFIG); addConfig(ThumbnailAsideConfig::self(), this); diff --git a/effects/trackmouse/trackmouse.cpp b/effects/trackmouse/trackmouse.cpp index f923421049..8a2630089f 100644 --- a/effects/trackmouse/trackmouse.cpp +++ b/effects/trackmouse/trackmouse.cpp @@ -63,10 +63,9 @@ TrackMouseEffect::TrackMouseEffect() KGlobalAccel::self()->setShortcut(m_action, QList()); effects->registerGlobalShortcut(QKeySequence(), m_action); - connect(m_action, SIGNAL(triggered(bool)), this, SLOT(toggle())); + connect(m_action, &QAction::triggered, this, &TrackMouseEffect::toggle); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + connect(effects, &EffectsHandler::mouseChanged, this, &TrackMouseEffect::slotMouseChanged); reconfigure(ReconfigureAll); } diff --git a/effects/trackmouse/trackmouse_config.cpp b/effects/trackmouse/trackmouse_config.cpp index 94d3211932..61b04b6704 100644 --- a/effects/trackmouse/trackmouse_config.cpp +++ b/effects/trackmouse/trackmouse_config.cpp @@ -73,8 +73,8 @@ TrackMouseEffectConfig::TrackMouseEffectConfig(QWidget* parent, const QVariantLi KGlobalAccel::self()->setDefaultShortcut(a, QList()); KGlobalAccel::self()->setShortcut(a, QList()); - connect(m_ui->shortcut, SIGNAL(keySequenceChanged(QKeySequence)), - SLOT(shortcutChanged(QKeySequence))); + connect(m_ui->shortcut, &KKeySequenceWidget::keySequenceChanged, + this, &TrackMouseEffectConfig::shortcutChanged); load(); } diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp index 8d66eadc64..cdffdaa036 100644 --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -56,11 +56,11 @@ WindowGeometry::WindowGeometry() KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::SHIFT + Qt::Key_F11); effects->registerGlobalShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_F11, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle())); + connect(a, &QAction::triggered, this, &WindowGeometry::toggle); - connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*,QRect))); + connect(effects, &EffectsHandler::windowStartUserMovedResized, this, &WindowGeometry::slotWindowStartUserMovedResized); + connect(effects, &EffectsHandler::windowFinishUserMovedResized, this, &WindowGeometry::slotWindowFinishUserMovedResized); + connect(effects, &EffectsHandler::windowStepUserMovedResized, this, &WindowGeometry::slotWindowStepUserMovedResized); } WindowGeometry::~WindowGeometry() diff --git a/effects/windowgeometry/windowgeometry_config.cpp b/effects/windowgeometry/windowgeometry_config.cpp index 3544e4c7f7..b2b58417e3 100644 --- a/effects/windowgeometry/windowgeometry_config.cpp +++ b/effects/windowgeometry/windowgeometry_config.cpp @@ -62,7 +62,7 @@ WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList& KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::SHIFT + Qt::Key_F11); myUi->shortcuts->addCollection(myActionCollection); - connect(myUi->shortcuts, SIGNAL(keyChange()), this, SLOT(changed())); + connect(myUi->shortcuts, &KShortcutsEditor::keyChange, this, qOverload<>(&WindowGeometryConfig::changed)); addConfig(WindowGeometryConfiguration::self(), myUi); diff --git a/effects/wobblywindows/wobblywindows.cpp b/effects/wobblywindows/wobblywindows.cpp index cd50ae732f..40f543aef3 100644 --- a/effects/wobblywindows/wobblywindows.cpp +++ b/effects/wobblywindows/wobblywindows.cpp @@ -141,13 +141,12 @@ WobblyWindowsEffect::WobblyWindowsEffect() { initConfig(); reconfigure(ReconfigureAll); - connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*,QRect))); - connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*))); - connect(effects, SIGNAL(windowMaximizedStateChanged(KWin::EffectWindow*,bool,bool)), this, SLOT(slotWindowMaximizeStateChanged(KWin::EffectWindow*,bool,bool))); - + connect(effects, &EffectsHandler::windowAdded, this, &WobblyWindowsEffect::slotWindowAdded); + connect(effects, &EffectsHandler::windowClosed, this, &WobblyWindowsEffect::slotWindowClosed); + connect(effects, &EffectsHandler::windowStartUserMovedResized, this, &WobblyWindowsEffect::slotWindowStartUserMovedResized); + connect(effects, &EffectsHandler::windowStepUserMovedResized, this, &WobblyWindowsEffect::slotWindowStepUserMovedResized); + connect(effects, &EffectsHandler::windowFinishUserMovedResized, this, &WobblyWindowsEffect::slotWindowFinishUserMovedResized); + connect(effects, &EffectsHandler::windowMaximizedStateChanged, this, &WobblyWindowsEffect::slotWindowMaximizeStateChanged); connect(effects, &EffectsHandler::windowDataChanged, this, &WobblyWindowsEffect::cancelWindowGrab); } diff --git a/effects/wobblywindows/wobblywindows_config.cpp b/effects/wobblywindows/wobblywindows_config.cpp index d9eaf5bdfc..05178b0751 100644 --- a/effects/wobblywindows/wobblywindows_config.cpp +++ b/effects/wobblywindows/wobblywindows_config.cpp @@ -87,7 +87,7 @@ WobblyWindowsEffectConfig::WobblyWindowsEffectConfig(QWidget* parent, const QVar m_ui.setupUi(this); addConfig(WobblyWindowsConfig::self(), this); - connect(m_ui.kcfg_WobblynessLevel, SIGNAL(valueChanged(int)), this, SLOT(wobblinessChanged())); + connect(m_ui.kcfg_WobblynessLevel, &QSlider::valueChanged, this, &WobblyWindowsEffectConfig::wobblinessChanged); load(); } diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index efdec578a0..d239c9e4f2 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -85,7 +85,7 @@ ZoomEffect::ZoomEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList()); KGlobalAccel::self()->setShortcut(a, QList()); effects->registerGlobalShortcut(QKeySequence(), a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomLeft())); + connect(a, &QAction::triggered, this, &ZoomEffect::moveZoomLeft); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomRight")); @@ -93,7 +93,7 @@ ZoomEffect::ZoomEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList()); KGlobalAccel::self()->setShortcut(a, QList()); effects->registerGlobalShortcut(QKeySequence(), a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomRight())); + connect(a, &QAction::triggered, this, &ZoomEffect::moveZoomRight); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomUp")); @@ -101,7 +101,7 @@ ZoomEffect::ZoomEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList()); KGlobalAccel::self()->setShortcut(a, QList()); effects->registerGlobalShortcut(QKeySequence(), a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomUp())); + connect(a, &QAction::triggered, this, &ZoomEffect::moveZoomUp); a = new QAction(this); a->setObjectName(QStringLiteral("MoveZoomDown")); @@ -109,7 +109,7 @@ ZoomEffect::ZoomEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList()); KGlobalAccel::self()->setShortcut(a, QList()); effects->registerGlobalShortcut(QKeySequence(), a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomDown())); + connect(a, &QAction::triggered, this, &ZoomEffect::moveZoomDown); // TODO: these two actions don't belong into the effect. They need to be moved into KWin core a = new QAction(this); @@ -118,7 +118,7 @@ ZoomEffect::ZoomEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_F5); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_F5); effects->registerGlobalShortcut(Qt::META + Qt::Key_F5, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(moveMouseToFocus())); + connect(a, &QAction::triggered, this, &ZoomEffect::moveMouseToFocus); a = new QAction(this); a->setObjectName(QStringLiteral("MoveMouseToCenter")); @@ -126,13 +126,12 @@ ZoomEffect::ZoomEffect() KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_F6); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_F6); effects->registerGlobalShortcut(Qt::META + Qt::Key_F6, a); - connect(a, SIGNAL(triggered(bool)), this, SLOT(moveMouseToCenter())); + connect(a, &QAction::triggered, this, &ZoomEffect::moveMouseToCenter); timeline.setDuration(350); timeline.setFrameRange(0, 100); - connect(&timeline, SIGNAL(frameChanged(int)), this, SLOT(timelineFrameChanged(int))); - connect(effects, SIGNAL(mouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers)), - this, SLOT(slotMouseChanged(QPoint,QPoint,Qt::MouseButtons,Qt::MouseButtons,Qt::KeyboardModifiers,Qt::KeyboardModifiers))); + connect(&timeline, &QTimeLine::frameChanged, this, &ZoomEffect::timelineFrameChanged); + connect(effects, &EffectsHandler::mouseChanged, this, &ZoomEffect::slotMouseChanged); source_zoom = -1; // used to trigger initialZoom reading reconfigure(ReconfigureAll); diff --git a/effects/zoom/zoom_config.cpp b/effects/zoom/zoom_config.cpp index 9bc02e4176..611ca7ccba 100644 --- a/effects/zoom/zoom_config.cpp +++ b/effects/zoom/zoom_config.cpp @@ -58,7 +58,7 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : addConfig(ZoomConfig::self(), m_ui); - connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&ZoomEffectConfig::changed)); // Shortcut config. The shortcut belongs to the component "kwin"! KActionCollection *actionCollection = new KActionCollection(this, QStringLiteral("kwin"));