]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Switch to C++20
authorMéven Car <meven@kde.org>
Sun, 24 Nov 2024 13:40:25 +0000 (14:40 +0100)
committerMéven Car <meven@kde.org>
Mon, 25 Nov 2024 12:52:33 +0000 (12:52 +0000)
CMakeLists.txt
src/dolphinviewcontainer.cpp
src/itemactions/movetonewfolderitemaction.cpp
src/kitemviews/kitemlistview.cpp
src/panels/terminal/terminalpanel.cpp
src/settings/viewmodes/contentdisplaytab.cpp
src/views/dolphinview.cpp

index 4960045411cdf7a78d87c4a1cd94d29ab88925b2..bc00ca9818d732e4d6cb6545b04cdd6f2dbaaf15 100644 (file)
@@ -10,6 +10,11 @@ project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
 set(QT_MIN_VERSION "6.4.0")
 set(KF6_MIN_VERSION "6.2.0")
 
+# use C++20 like KF6 itself
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+
 # ECM setup
 find_package(ECM ${KF6_MIN_VERSION} CONFIG REQUIRED)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
index c6c56ce240deb5a0340a8bdfcf7bbc7ba2bae1b7..5494d7c41006cca93a9cb7e011e93674fc89a181 100644 (file)
@@ -303,7 +303,7 @@ void DolphinViewContainer::connectUrlNavigator(DolphinUrlNavigator *urlNavigator
 
     // Url changes are still done via m_urlNavigator.
     connect(urlNavigator, &DolphinUrlNavigator::urlChanged, m_urlNavigator.get(), &DolphinUrlNavigator::setLocationUrl);
-    connect(urlNavigator, &DolphinUrlNavigator::urlsDropped, this, [=](const QUrl &destination, QDropEvent *event) {
+    connect(urlNavigator, &DolphinUrlNavigator::urlsDropped, this, [=, this](const QUrl &destination, QDropEvent *event) {
         m_view->dropUrls(destination, event, urlNavigator->dropWidget());
     });
     // Aside from these, only visual things need to be connected.
index 2959003315ba61abdc13d8a281a2f48117732f3c..cfd6f25eef9d8a2156a6f82111286555e9b15475 100644 (file)
@@ -30,7 +30,7 @@ QList<QAction *> MoveToNewFolderItemAction::actions(const KFileItemListPropertie
 
     QAction *createFolderFromSelected = new QAction(i18nc("@action:inmenu", "Move to New Folder…"), parentWidget);
     createFolderFromSelected->setIcon(QIcon::fromTheme(QStringLiteral("folder-new")));
-    connect(createFolderFromSelected, &QAction::triggered, this, [=]() {
+    connect(createFolderFromSelected, &QAction::triggered, this, [=, this]() {
         QString selectedFileDirPath = selectedItems.at(0).url().toString().remove(selectedItems.at(0).name());
         if (selectedFileDirPath.endsWith(QStringLiteral("/"))) {
             selectedFileDirPath.removeLast();
index b0ea32940f2e9b80b59f409c7e78cdb8cc25a8e1..38ec6841a8bd4bd2bd0bf4022c18385a09ec2754 100644 (file)
@@ -1608,10 +1608,10 @@ void KItemListView::slotRubberBandActivationChanged(bool active)
         curve.addCubicBezierSegment(QPointF(0.4, 0.0), QPointF(1.0, 1.0), QPointF(1.0, 1.0));
         animation->setEasingCurve(curve);
 
-        connect(animation, &QVariantAnimation::valueChanged, this, [=](const QVariant &) {
+        connect(animation, &QVariantAnimation::valueChanged, this, [=, this](const QVariant &) {
             update();
         });
-        connect(animation, &QVariantAnimation::finished, this, [=]() {
+        connect(animation, &QVariantAnimation::finished, this, [=, this]() {
             m_rubberBandAnimations.removeAll(animation);
             delete animation;
         });
index 5b17023a39240558142a796474a40a6a9d8420ae..92ba18bf513cee88a21b1c959e45f18576b248a5 100644 (file)
@@ -278,7 +278,7 @@ void TerminalPanel::sendCdToTerminalKIOFuse(const QUrl &url)
     // If we can't do that for any reason, silently fail.
     auto reply = m_kiofuseInterface.mountUrl(url.toString());
     QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
-    QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=](QDBusPendingCallWatcher *watcher) {
+    QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=, this](QDBusPendingCallWatcher *watcher) {
         watcher->deleteLater();
         if (!reply.isError()) {
             // Successfully mounted, point to the KIOFuse equivalent path.
@@ -326,7 +326,7 @@ void TerminalPanel::slotKonsolePartCurrentDirectoryChanged(const QString &dir)
 
     auto reply = m_kiofuseInterface.remoteUrl(m_konsolePartCurrentDirectory);
     QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
-    QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=](QDBusPendingCallWatcher *watcher) {
+    QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=, this](QDBusPendingCallWatcher *watcher) {
         watcher->deleteLater();
         if (reply.isError()) {
             // KIOFuse errored out... just show the normal URL
index 2d817277ca9161bb3f0f83f71b3b824a3413eb12..c08c4c1919a7c396c814625a36823aff8ac24d3e 100644 (file)
@@ -106,7 +106,7 @@ ContentDisplayTab::ContentDisplayTab(QWidget *parent)
 #ifndef Q_OS_WIN
     connect(m_recursiveDirectorySizeLimit, &QSpinBox::valueChanged, this, &SettingsPageBase::changed);
     connect(m_numberOfItems, &QRadioButton::toggled, this, &SettingsPageBase::changed);
-    connect(m_sizeOfContents, &QRadioButton::toggled, this, [=]() {
+    connect(m_sizeOfContents, &QRadioButton::toggled, this, [=, this]() {
         m_recursiveDirectorySizeLimit->setEnabled(m_sizeOfContents->isChecked());
     });
     connect(m_noDirectorySize, &QRadioButton::toggled, this, &SettingsPageBase::changed);
index d9d7f2ef37701dd975b18554b81bbbe2aed2253d..2f2ff586d10c6e9fd0b92b821587ed5a11b3126d 100644 (file)
@@ -137,10 +137,10 @@ DolphinView::DolphinView(const QUrl &url, QWidget *parent)
     m_view->setAccessibleParentsObject(m_container);
 #endif
     setFocusProxy(m_container);
-    connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, [=] {
+    connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, [this] {
         hideToolTip();
     });
-    connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, [=] {
+    connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, [this] {
         hideToolTip();
     });