diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ set(PROJECT_VERSION "5.18.80") set(PROJECT_VERSION_MAJOR 5) -set(QT_MIN_VERSION "5.12.0") +set(QT_MIN_VERSION "5.14.0") set(KF5_MIN_VERSION "5.66.0") set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) diff --git a/abstract_wayland_output.cpp b/abstract_wayland_output.cpp --- a/abstract_wayland_output.cpp +++ b/abstract_wayland_output.cpp @@ -196,7 +196,7 @@ overallSizeCheckNeeded = true; } if (changeSet->scaleChanged()) { - qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale(); + qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scaleF(); setScale(changeSet->scaleF()); emitModeChanged = true; } diff --git a/debug_console.cpp b/debug_console.cpp --- a/debug_console.cpp +++ b/debug_console.cpp @@ -709,7 +709,7 @@ QString DebugConsoleDelegate::displayText(const QVariant &value, const QLocale &locale) const { - switch (value.type()) { + switch (value.userType()) { case QMetaType::QPoint: { const QPoint p = value.toPoint(); return QStringLiteral("%1,%2").arg(p.x()).arg(p.y()); diff --git a/decorations/settings.cpp b/decorations/settings.cpp --- a/decorations/settings.cpp +++ b/decorations/settings.cpp @@ -56,9 +56,7 @@ ); // prevent changes in Decoration due to Compositor being destroyed connect(Compositor::self(), &Compositor::aboutToDestroy, this, - [this, c] { - disconnect(c); - } + [c] { disconnect(c); } ); connect(Workspace::self(), &Workspace::configChanged, this, &SettingsImpl::readSettings); connect(DecorationBridge::self(), &DecorationBridge::metaDataLoaded, this, &SettingsImpl::readSettings); diff --git a/effects/highlightwindow/highlightwindow.cpp b/effects/highlightwindow/highlightwindow.cpp --- a/effects/highlightwindow/highlightwindow.cpp +++ b/effects/highlightwindow/highlightwindow.cpp @@ -61,7 +61,7 @@ if (!m_highlightedWindows.isEmpty()) { // Initial fade out and changing highlight animation if (opacity == m_windowOpacity.end()) - opacity = m_windowOpacity.insertMulti(w, 0.0f); + opacity = m_windowOpacity.insert(w, 0.0f); float oldOpacity = *opacity; if (m_highlightedWindows.contains(w)) *opacity = qMin(1.0f, oldOpacity + time / m_fadeDuration); @@ -250,7 +250,7 @@ m_finishing = false; foreach (EffectWindow * w, effects->stackingOrder()) { if (!m_windowOpacity.contains(w)) // Just in case we are still finishing from last time - m_windowOpacity.insertMulti(w, isInitiallyHidden(w) ? 0.0 : 1.0); + m_windowOpacity.insert(w, isInitiallyHidden(w) ? 0.0 : 1.0); if (!m_highlightedWindows.isEmpty()) m_highlightedWindows.at(0)->addRepaintFull(); } diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -658,7 +658,7 @@ // see https://github.com/qt/qtbase/blob/dev/src/opengl/qgl.cpp if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // OpenGL gives RGBA; Qt wants ARGB - uint *p = (uint*)img.bits(); + uint *p = reinterpret_cast(img.bits()); uint *end = p + w * h; while (p < end) { uint a = *p << 24; @@ -668,7 +668,7 @@ } else { // OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB for (int y = 0; y < h; y++) { - uint *q = (uint*)img.scanLine(y); + uint *q = reinterpret_cast(img.scanLine(y)); for (int x = 0; x < w; ++x) { const uint pixel = *q; *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) diff --git a/effects/showfps/showfps.h b/effects/showfps/showfps.h --- a/effects/showfps/showfps.h +++ b/effects/showfps/showfps.h @@ -21,7 +21,7 @@ #ifndef KWIN_SHOWFPS_H #define KWIN_SHOWFPS_H -#include +#include #include #include @@ -83,7 +83,7 @@ void paintDrawSizeGraph(int x, int y); void paintGraph(int x, int y, QList values, QList lines, bool colorize); QImage fpsTextImage(int fps); - QTime t; + QElapsedTimer t; enum { NUM_PAINTS = 100 }; // remember time needed to paint this many paints int paints[ NUM_PAINTS ]; // time needed to paint int paint_size[ NUM_PAINTS ]; // number of pixels painted diff --git a/effects/showfps/showfps.cpp b/effects/showfps/showfps.cpp --- a/effects/showfps/showfps.cpp +++ b/effects/showfps/showfps.cpp @@ -123,11 +123,7 @@ void ShowFpsEffect::prePaintScreen(ScreenPrePaintData& data, int time) { - if (time == 0) { - // TODO optimized away - } - t.start(); - frames[ frames_pos ] = t.minute() * 60000 + t.second() * 1000 + t.msec(); + frames[ frames_pos ] = t.restart(); if (++frames_pos == MAX_FPS) frames_pos = 0; effects->prePaintScreen(data, time); @@ -158,7 +154,7 @@ for (int i = 0; i < MAX_FPS; ++i) - if (abs(t.minute() * 60000 + t.second() * 1000 + t.msec() - frames[ i ]) < 1000) + if (abs(t.elapsed() - frames[ i ]) < 1000) ++fps; // count all frames in the last second if (fps > MAX_TIME) fps = MAX_TIME; // keep it the same height diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -1787,7 +1787,7 @@ connect(fakeInput, &FakeInputInterface::deviceCreated, this, [this] (FakeInputDevice *device) { connect(device, &FakeInputDevice::authenticationRequested, this, - [this, device] (const QString &application, const QString &reason) { + [device] (const QString &application, const QString &reason) { Q_UNUSED(application) Q_UNUSED(reason) // TODO: make secure diff --git a/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp b/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp --- a/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp +++ b/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp @@ -111,7 +111,7 @@ connect(this, &PreviewClient::bordersLeftEdgeChanged, this, emitEdgesChanged); connect(this, &PreviewClient::bordersRightEdgeChanged, this, emitEdgesChanged); connect(this, &PreviewClient::bordersBottomEdgeChanged, this, emitEdgesChanged); - auto emitSizeChanged = [this, c]() { + auto emitSizeChanged = [c]() { emit c->sizeChanged(c->size()); }; connect(this, &PreviewClient::widthChanged, this, emitSizeChanged); diff --git a/kcmkwin/kwintabbox/main.cpp b/kcmkwin/kwintabbox/main.cpp --- a/kcmkwin/kwintabbox/main.cpp +++ b/kcmkwin/kwintabbox/main.cpp @@ -490,7 +490,7 @@ CHECK_CURRENT_TABBOX_UI on = !on || ui->effectCombo->currentIndex() >= Layout; ui->highlightWindowCheck->setEnabled(on); - emit changed(); + markAsChanged(); } void KWinTabBoxConfig::configureEffectClicked() diff --git a/layers.cpp b/layers.cpp --- a/layers.cpp +++ b/layers.cpp @@ -509,7 +509,7 @@ QList layer[ NumLayers ]; // build the order from layers - QVector< QMap > minimum_layer(screens()->count()); + QVector< QMultiMap > minimum_layer(screens()->count()); for (auto it = unconstrained_stacking_order.constBegin(), end = unconstrained_stacking_order.constEnd(); it != end; ++it) { Layer l = (*it)->layer(); @@ -525,7 +525,7 @@ l = ActiveLayer; *mLayer = l; } else if (c) { - minimum_layer[screen].insertMulti(c->group(), l); + minimum_layer[screen].insert(c->group(), l); } layer[ l ].append(*it); } diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -687,7 +687,8 @@ } } else { const QByteArray extensions = (const char *) glGetString(GL_EXTENSIONS); - m_extensions = QSet::fromList(extensions.split(' ')); + QList extensionsList = extensions.split(' '); + m_extensions = {extensionsList.constBegin(), extensionsList.constEnd()}; } // Parse the Mesa version diff --git a/main_wayland.cpp b/main_wayland.cpp --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -225,28 +225,28 @@ environment.remove("WAYLAND_DISPLAY"); QProcess *p = new Process(this); p->setProcessChannelMode(QProcess::ForwardedErrorChannel); - auto finishedSignal = static_cast(&QProcess::finished); - connect(p, finishedSignal, this, - [this, p] { + connect(p, qOverload(&QProcess::finished), this, + [p] { if (waylandServer()) { waylandServer()->destroyInputMethodConnection(); } p->deleteLater(); } ); p->setProcessEnvironment(environment); - p->start(m_inputMethodServerToStart); - p->waitForStarted(); + p->setProgram(m_inputMethodServerToStart); + p->start(); + p->waitForStarted(); //do we really need to wait? } } // start session if (!m_sessionArgument.isEmpty()) { QProcess *p = new Process(this); p->setProcessChannelMode(QProcess::ForwardedErrorChannel); p->setProcessEnvironment(processStartupEnvironment()); - auto finishedSignal = static_cast(&QProcess::finished); - connect(p, finishedSignal, this, [](int code, QProcess::ExitStatus status) { + connect(p, qOverload(&QProcess::finished), this, [p] (int code, QProcess::ExitStatus status) { + p->deleteLater(); if (status == QProcess::CrashExit) { qWarning() << "Session process has crashed"; QCoreApplication::exit(-1); @@ -259,7 +259,8 @@ QCoreApplication::exit(code); }); - p->start(m_sessionArgument); + p->setProgram(m_sessionArgument); + p->start(); } // start the applications passed to us as command line arguments if (!m_applicationsToStart.isEmpty()) { @@ -269,7 +270,9 @@ QProcess *p = new Process(this); p->setProcessChannelMode(QProcess::ForwardedErrorChannel); p->setProcessEnvironment(processStartupEnvironment()); - p->start(application); + p->setProgram(application); + p->startDetached(); + p->deleteLater(); } } } diff --git a/plugins/kdecorations/aurorae/src/aurorae.cpp b/plugins/kdecorations/aurorae/src/aurorae.cpp --- a/plugins/kdecorations/aurorae/src/aurorae.cpp +++ b/plugins/kdecorations/aurorae/src/aurorae.cpp @@ -354,22 +354,24 @@ connect(m_extendedBorders, &KWin::Borders::topChanged, this, &Decoration::updateExtendedBorders); connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, &Decoration::updateExtendedBorders); } - connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection); - connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateBorders); + + auto decorationClient = clientPointer(); + connect(decorationClient, &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection); + connect(decorationClient, &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateBorders); updateBorders(); if (m_view) { auto resizeWindow = [this] { QRect rect(QPoint(0, 0), size()); - if (m_padding && !client().data()->isMaximized()) { + if (m_padding && !clientPointer()->isMaximized()) { rect = rect.adjusted(-m_padding->left(), -m_padding->top(), m_padding->right(), m_padding->bottom()); } m_view->setGeometry(rect); }; connect(this, &Decoration::bordersChanged, this, resizeWindow); - connect(client().data(), &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow); - connect(client().data(), &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow); - connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow); - connect(client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow); + connect(decorationClient, &KDecoration2::DecoratedClient::widthChanged, this, resizeWindow); + connect(decorationClient, &KDecoration2::DecoratedClient::heightChanged, this, resizeWindow); + connect(decorationClient, &KDecoration2::DecoratedClient::maximizedChanged, this, resizeWindow); + connect(decorationClient, &KDecoration2::DecoratedClient::shadedChanged, this, resizeWindow); resizeWindow(); updateBuffer(); } else { @@ -400,7 +402,7 @@ void Decoration::updateBorders() { KWin::Borders *b = m_borders; - if (client().data()->isMaximized() && m_maximizedBorders) { + if (clientPointer()->isMaximized() && m_maximizedBorders) { b = m_maximizedBorders; } if (!b) { @@ -430,7 +432,7 @@ const auto oldShadow = shadow(); if (m_padding && (m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) && - !client().data()->isMaximized()) { + !clientPointer()->isMaximized()) { if (oldShadow.isNull()) { updateShadow = true; } else { @@ -564,15 +566,15 @@ int extBottom = m_extendedBorders->bottom(); if (settings()->borderSize() == KDecoration2::BorderSize::None) { - if (!client().data()->isMaximizedHorizontally()) { + if (!clientPointer()->isMaximizedHorizontally()) { extLeft = qMax(m_extendedBorders->left(), extSize); extRight = qMax(m_extendedBorders->right(), extSize); } - if (!client().data()->isMaximizedVertically()) { + if (!clientPointer()->isMaximizedVertically()) { extBottom = qMax(m_extendedBorders->bottom(), extSize); } - } else if (settings()->borderSize() == KDecoration2::BorderSize::NoSides && !client().data()->isMaximizedHorizontally() ) { + } else if (settings()->borderSize() == KDecoration2::BorderSize::NoSides && !clientPointer()->isMaximizedHorizontally() ) { extLeft = qMax(m_extendedBorders->left(), extSize); extRight = qMax(m_extendedBorders->right(), extSize); } @@ -585,16 +587,16 @@ m_contentRect = QRect(QPoint(0, 0), m_view->bufferAsImage().size()); if (m_padding && (m_padding->left() > 0 || m_padding->top() > 0 || m_padding->right() > 0 || m_padding->bottom() > 0) && - !client().data()->isMaximized()) { + !clientPointer()->isMaximized()) { m_contentRect = m_contentRect.adjusted(m_padding->left(), m_padding->top(), -m_padding->right(), -m_padding->bottom()); } updateShadow(); update(); } KDecoration2::DecoratedClient *Decoration::clientPointer() const { - return client().data(); + return client().toStrongRef().data(); } ThemeFinder::ThemeFinder(QObject *parent, const QVariantList &args) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -781,11 +781,11 @@ QString supportInfo; QDebug s(&supportInfo); s.nospace(); - s << "Name: " << "DRM" << endl; - s << "Active: " << m_active << endl; - s << "Atomic Mode Setting: " << m_atomicModeSetting << endl; + s << "Name: " << "DRM" << Qt::endl; + s << "Active: " << m_active << Qt::endl; + s << "Atomic Mode Setting: " << m_atomicModeSetting << Qt::endl; #if HAVE_EGL_STREAMS - s << "Using EGL Streams: " << m_useEglStreams << endl; + s << "Using EGL Streams: " << m_useEglStreams << Qt::endl; #endif return supportInfo; } diff --git a/plugins/platforms/drm/edid.cpp b/plugins/platforms/drm/edid.cpp --- a/plugins/platforms/drm/edid.cpp +++ b/plugins/platforms/drm/edid.cpp @@ -155,6 +155,8 @@ } } } +#else + Q_UNUSED(data) #endif return {}; } diff --git a/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp b/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp --- a/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp +++ b/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp @@ -45,7 +45,7 @@ m_backBuffer.fill(Qt::black); connect(VirtualTerminal::self(), &VirtualTerminal::activeChanged, this, - [this] (bool active) { + [] (bool active) { if (active) { Compositor::self()->bufferSwapComplete(); Compositor::self()->addRepaintFull(); diff --git a/plugins/platforms/virtual/egl_gbm_backend.cpp b/plugins/platforms/virtual/egl_gbm_backend.cpp --- a/plugins/platforms/virtual/egl_gbm_backend.cpp +++ b/plugins/platforms/virtual/egl_gbm_backend.cpp @@ -194,7 +194,7 @@ // see https://github.com/qt/qtbase/blob/dev/src/opengl/qgl.cpp if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { // OpenGL gives RGBA; Qt wants ARGB - uint *p = (uint*)img.bits(); + uint *p = reinterpret_cast(img.bits()); uint *end = p + w * h; while (p < end) { uint a = *p << 24; @@ -204,7 +204,7 @@ } else { // OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB for (int y = 0; y < h; y++) { - uint *q = (uint*)img.scanLine(y); + uint *q = reinterpret_cast(img.scanLine(y)); for (int x = 0; x < w; ++x) { const uint pixel = *q; *q = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) diff --git a/plugins/platforms/wayland/wayland_backend.cpp b/plugins/platforms/wayland/wayland_backend.cpp --- a/plugins/platforms/wayland/wayland_backend.cpp +++ b/plugins/platforms/wayland/wayland_backend.cpp @@ -103,7 +103,9 @@ doInstallImage(nullptr, QSize()); return; } - wl_buffer *imageBuffer = *(m_backend->shmPool()->createBuffer(image).data()); + + auto buffer = m_backend->shmPool()->createBuffer(image).toStrongRef(); + wl_buffer *imageBuffer = *buffer.data(); doInstallImage(imageBuffer, image.size()); } @@ -675,7 +677,7 @@ if (ssdManager) { auto decoration = ssdManager->create(surface, this); connect(decoration, &ServerSideDecoration::modeChanged, this, - [this, decoration] { + [decoration] { if (decoration->mode() != ServerSideDecoration::Mode::Server) { decoration->requestMode(ServerSideDecoration::Mode::Server); } diff --git a/plugins/platforms/x11/standalone/glxbackend.cpp b/plugins/platforms/x11/standalone/glxbackend.cpp --- a/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/plugins/platforms/x11/standalone/glxbackend.cpp @@ -573,7 +573,7 @@ const xcb_render_directformat_t *direct = XRenderUtils::findPictFormatInfo(format); if (!direct) { - qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a picture format for visual 0x" << hex << visual; + qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a picture format for visual 0x" << Qt::hex << visual; return info; } @@ -607,7 +607,7 @@ GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, &count); if (count < 1) { - qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a framebuffer configuration for visual 0x" << hex << visual; + qCCritical(KWIN_X11STANDALONE).nospace() << "Could not find a framebuffer configuration for visual 0x" << Qt::hex << visual; return info; } @@ -689,7 +689,7 @@ glXGetFBConfigAttrib(display(), info->fbconfig, GLX_FBCONFIG_ID, &fbc_id); glXGetFBConfigAttrib(display(), info->fbconfig, GLX_VISUAL_ID, &visual_id); - qCDebug(KWIN_X11STANDALONE).nospace() << "Using FBConfig 0x" << hex << fbc_id << " for visual 0x" << hex << visual_id; + qCDebug(KWIN_X11STANDALONE).nospace() << "Using FBConfig 0x" << Qt::hex << fbc_id << " for visual 0x" << Qt::hex << visual_id; } return info; diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -2110,7 +2110,7 @@ { Q_ASSERT(shadow->hasDecorationShadow()); unregister(shadow); - const auto &decoShadow = shadow->decorationShadow(); + const auto &decoShadow = shadow->decorationShadow().toStrongRef(); Q_ASSERT(!decoShadow.isNull()); auto it = m_cache.find(decoShadow.data()); if (it != m_cache.end()) { diff --git a/tabbox/clientmodel.cpp b/tabbox/clientmodel.cpp --- a/tabbox/clientmodel.cpp +++ b/tabbox/clientmodel.cpp @@ -164,12 +164,12 @@ void ClientModel::createClientList(int desktop, bool partialReset) { - TabBoxClient* start = tabBox->activeClient().toStrongRef().data(); + auto start = tabBox->activeClient().toStrongRef(); // TODO: new clients are not added at correct position if (partialReset && !m_clientList.isEmpty()) { - QSharedPointer firstClient = m_clientList.first().toStrongRef(); + QSharedPointer firstClient = m_clientList.constFirst(); if (firstClient) { - start = firstClient.data(); + start = firstClient; } } @@ -179,34 +179,34 @@ switch(tabBox->config().clientSwitchingMode()) { case TabBoxConfig::FocusChainSwitching: { - TabBoxClient* c = start; - if (!tabBox->isInFocusChain(c)) { + auto c = start; + if (!tabBox->isInFocusChain(c.data())) { QSharedPointer firstClient = tabBox->firstClientFocusChain().toStrongRef(); if (firstClient) { - c = firstClient.data(); + c = firstClient; } } - TabBoxClient* stop = c; + auto stop = c; do { - QWeakPointer add = tabBox->clientToAddToList(c, desktop); + QSharedPointer add = tabBox->clientToAddToList(c.data(), desktop); if (!add.isNull()) { m_clientList += add; if (add.data()->isFirstInTabBox()) { stickyClients << add; } } - c = tabBox->nextClientFocusChain(c).data(); + c = tabBox->nextClientFocusChain(c.data()); } while (c && c != stop); break; } case TabBoxConfig::StackingOrderSwitching: { // TODO: needs improvement - TabBoxClientList stacking = tabBox->stackingOrder(); - TabBoxClient* c = stacking.first().data(); - TabBoxClient* stop = c; + const TabBoxClientList stacking = tabBox->stackingOrder(); + auto c = stacking.first().toStrongRef(); + auto stop = c; int index = 0; while (c) { - QWeakPointer add = tabBox->clientToAddToList(c, desktop); + QSharedPointer add = tabBox->clientToAddToList(c.data(), desktop); if (!add.isNull()) { if (start == add.data()) { m_clientList.removeAll(add); @@ -220,7 +220,7 @@ if (index >= stacking.size() - 1) { c = nullptr; } else { - c = stacking[++index].data(); + c = stacking[++index]; } if (c == stop) diff --git a/useractions.cpp b/useractions.cpp --- a/useractions.cpp +++ b/useractions.cpp @@ -326,7 +326,7 @@ p->setProcessEnvironment(kwinApp()->processStartupEnvironment()); p->setProgram(QStringLiteral("kcmshell5")); connect(p, static_cast(&QProcess::finished), p, &QProcess::deleteLater); - connect(p, &QProcess::errorOccurred, this, [p](QProcess::ProcessError e) { + connect(p, &QProcess::errorOccurred, this, [] (QProcess::ProcessError e) { if (e == QProcess::FailedToStart) { qCDebug(KWIN_CORE) << "Failed to start kcmshell5"; } diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -424,7 +424,7 @@ c->installServerSideDecoration(deco); } connect(deco, &ServerSideDecorationInterface::modeRequested, this, - [this, deco] (ServerSideDecorationManagerInterface::Mode mode) { + [deco] (ServerSideDecorationManagerInterface::Mode mode) { // always acknowledge the requested mode deco->setMode(mode); } @@ -435,7 +435,7 @@ m_outputManagement = m_display->createOutputManagement(m_display); connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, - this, [this](KWayland::Server::OutputConfigurationInterface *config) { + this, [](KWayland::Server::OutputConfigurationInterface *config) { kwinApp()->platform()->requestOutputsChange(config); }); m_outputManagement->create(); @@ -731,7 +731,7 @@ quint16 WaylandServer::createClientId(ClientConnection *c) { - auto ids = m_clientIds.values().toSet(); + const QSet ids(m_clientIds.constBegin(), m_clientIds.constEnd()); quint16 id = 1; if (!ids.isEmpty()) { for (quint16 i = ids.count() + 1; i >= 1 ; i--) { diff --git a/xwl/drag_x.cpp b/xwl/drag_x.cpp --- a/xwl/drag_x.cpp +++ b/xwl/drag_x.cpp @@ -68,7 +68,7 @@ connect(DataBridge::self()->dnd(), &Dnd::transferFinished, this, [this](xcb_timestamp_t eventTime) { // we use this mechanism, because the finished call is not // reliable done by Wayland clients - auto it = std::find_if(m_dataRequests.begin(), m_dataRequests.end(), [this, eventTime](QPair req) { + auto it = std::find_if(m_dataRequests.begin(), m_dataRequests.end(), [eventTime](const QPair &req) { return req.first == eventTime; }); if (it == m_dataRequests.end()) {