]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'master' into kf6
authorNicolas Fella <nicolas.fella@gmx.de>
Mon, 10 Jul 2023 18:38:32 +0000 (20:38 +0200)
committerNicolas Fella <nicolas.fella@gmx.de>
Mon, 10 Jul 2023 18:38:32 +0000 (20:38 +0200)
59 files changed:
.gitlab-ci.yml
.kde-ci.yml
CMakeLists.txt
DolphinVcsConfig.cmake.in
doc/CMakeLists.txt
src/CMakeLists.txt
src/dolphincontextmenu.cpp
src/dolphinmainwindow.cpp
src/dolphinnavigatorswidgetaction.cpp
src/dolphinnewfilemenu.cpp
src/dolphinnewfilemenu.h
src/dolphinpart.cpp
src/dolphinpart_ext.cpp
src/dolphinpart_ext.h
src/dolphintabbar.cpp
src/dolphintabwidget.cpp
src/dolphinviewcontainer.cpp
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/private/kbaloorolesprovider.cpp
src/panels/folders/treeviewcontextmenu.cpp
src/panels/information/informationpanel.cpp
src/panels/information/informationpanelcontent.cpp
src/panels/information/phononwidget.cpp
src/panels/information/phononwidget.h
src/panels/places/placespanel.cpp
src/panels/terminal/terminalpanel.cpp
src/settings/contextmenu/contextmenusettingspage.cpp
src/settings/contextmenu/servicemenuinstaller/CMakeLists.txt
src/settings/general/configurepreviewplugindialog.cpp [deleted file]
src/settings/general/configurepreviewplugindialog.h [deleted file]
src/settings/general/previewssettingspage.cpp
src/settings/general/previewssettingspage.h
src/settings/kcm/kcmdolphingeneral.cpp
src/settings/kcm/kcmdolphingeneral.h
src/settings/kcm/kcmdolphinnavigation.cpp
src/settings/kcm/kcmdolphinnavigation.h
src/settings/kcm/kcmdolphinviewmodes.cpp
src/settings/kcm/kcmdolphinviewmodes.h
src/settings/serviceitemdelegate.cpp [deleted file]
src/settings/serviceitemdelegate.h [deleted file]
src/settings/servicemodel.cpp
src/settings/servicemodel.h
src/settings/startup/startupsettingspage.cpp
src/settings/trash/trashsettingspage.cpp
src/settings/trash/trashsettingspage.h
src/settings/userfeedback/userfeedbacksettingspage.cpp
src/tests/CMakeLists.txt
src/tests/kfileitemmodeltest.cpp
src/trash/dolphintrash.cpp
src/userfeedback/dolphinfeedbackprovider.cpp
src/userfeedback/dolphinfeedbackprovider.h
src/userfeedback/placesdatasource.cpp
src/userfeedback/placesdatasource.h
src/userfeedback/settingsdatasource.cpp
src/userfeedback/settingsdatasource.h
src/views/dolphinremoteencoding.cpp
src/views/dolphinview.cpp
src/views/dolphinviewactionhandler.cpp

index 9b09627599143a8cfdf42d6e6961c38842a7ebec..6c54587fa359fce765e1a556e11bff9a180be1fa 100644 (file)
@@ -1,4 +1,4 @@
 include:
-  - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
-  - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
-  - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows.yml
+  - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
+  - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml
+  - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows-qt6.yml
index a3ecb80993ff06102004078d5851a522a55236f6..68e460d4cd145b14c677661949cbec69f0052570 100644 (file)
@@ -2,36 +2,37 @@
 # SPDX-License-Identifier: CC0-1.0
 
 Dependencies:
-- 'on': ['@all']
+- 'on': ['Linux/Qt6', 'FreeBSD/Qt6', 'Windows/Qt6', 'macOS/Qt6']
   'require':
-    'frameworks/extra-cmake-modules': '@stable'
-    'frameworks/kcoreaddons': '@stable'
-    'frameworks/kcmutils': '@stable'
-    'frameworks/knewstuff': '@stable'
-    'frameworks/ki18n': '@stable'
-    'frameworks/kdbusaddons': '@stable'
-    'frameworks/kbookmarks': '@stable'
-    'frameworks/kconfig': '@stable'
-    'frameworks/kio': '@stable'
-    'frameworks/kparts': '@stable'
-    'frameworks/solid': '@stable'
-    'frameworks/kiconthemes': '@stable'
-    'frameworks/kcompletion': '@stable'
-    'frameworks/ktextwidgets': '@stable'
-    'frameworks/knotifications': '@stable'
-    'frameworks/kcrash': '@stable'
-    'frameworks/kwindowsystem': '@stable'
-    'frameworks/kactivities': '@stable'
-    'frameworks/kdoctools': '@stable'
-    'frameworks/kwindowsystem': '@stable'
-    'frameworks/kfilemetadata': '@stable'
-    'frameworks/kcodecs': '@stable'
-    'libraries/kuserfeedback': '@stable'
-    'libraries/phonon': '@stable'
+    'frameworks/extra-cmake-modules': '@latest-kf6'
+    'frameworks/kcoreaddons': '@latest-kf6'
+    'frameworks/kcmutils': '@latest-kf6'
+    'frameworks/knewstuff': '@latest-kf6'
+    'frameworks/ki18n': '@latest-kf6'
+    'frameworks/kdbusaddons': '@latest-kf6'
+    'frameworks/kbookmarks': '@latest-kf6'
+    'frameworks/kconfig': '@latest-kf6'
+    'frameworks/kio': '@latest-kf6'
+    'frameworks/kparts': '@latest-kf6'
+    'frameworks/solid': '@latest-kf6'
+    'frameworks/kiconthemes': '@latest-kf6'
+    'frameworks/kcompletion': '@latest-kf6'
+    'frameworks/ktextwidgets': '@latest-kf6'
+    'frameworks/knotifications': '@latest-kf6'
+    'frameworks/kcrash': '@latest-kf6'
+    'frameworks/kwindowsystem': '@latest-kf6'
+    'frameworks/kactivities': '@latest-kf6'
+    'frameworks/kdoctools': '@latest-kf6'
+    'frameworks/kwindowsystem': '@latest-kf6'
+    'frameworks/kfilemetadata': '@latest-kf6'
+    'frameworks/kcodecs': '@latest-kf6'
+    'libraries/kuserfeedback': '@latest-kf6'
+    'libraries/phonon': '@latest-kf6'
+    'libraries/kmoretools': '@latest-kf6'
 
-- 'on': ['Linux', 'FreeBSD']
+- 'on': ['Linux/Qt6', 'FreeBSD/Qt6']
   'require':
-    'frameworks/baloo': '@stable'
-    'libraries/baloo-widgets': '@same'
+    'frameworks/baloo': '@latest-kf6'
+    'libraries/baloo-widgets': '@latest-kf6'
     'third-party/packagekit-qt': '@latest'
 
index 3fa91d8a2610c5b12abd3ae6e903676eef10a1ae..6b712e70c24a0445512c0b1430dcefd539212328 100644 (file)
@@ -7,11 +7,11 @@ set (RELEASE_SERVICE_VERSION_MICRO "70")
 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
 project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
 
-set(QT_MIN_VERSION "5.15.2")
-set(KF5_MIN_VERSION "5.101.0")
+set(QT_MIN_VERSION "6.4.0")
+set(KF6_MIN_VERSION "5.240.0")
 
 # ECM setup
-find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
+find_package(ECM ${KF6_MIN_VERSION} CONFIG REQUIRED)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
 
 include(KDEInstallDirs)
@@ -32,14 +32,14 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHIN
                   VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/dolphin_version.h"
 )
 
-ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINVCS
+ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINVCS
                   VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
                   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
-                  SOVERSION 5
+                  SOVERSION ${QT_MAJOR_VERSION}
 )
 
-ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINPRIVATE
-                  SOVERSION 5
+ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
+                  SOVERSION ${QT_MAJOR_VERSION}
 )
 
 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
@@ -58,7 +58,7 @@ if (UNIX AND NOT APPLE)
     endif()
 endif()
 
-find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
+find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
     KCMUtils
     NewStuff
     CoreAddons
@@ -77,23 +77,24 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
     WindowSystem
     WidgetsAddons
     Codecs
+    MoreTools
 )
 
-find_package(KUserFeedback 1.2.0)
-set_package_properties(KUserFeedback
+find_package(KUserFeedbackQt6 1.2.1)
+set_package_properties(KUserFeedbackQt6
         PROPERTIES TYPE OPTIONAL
         PURPOSE "Used for submission of telemetry data"
         )
 
-if(KUserFeedback_FOUND)
+if(KUserFeedbackQt6_FOUND)
     set(HAVE_KUSERFEEDBACK TRUE)
 endif()
 
-find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS
+find_package(KF6 ${KF6_MIN_VERSION} OPTIONAL_COMPONENTS
     Activities
     DocTools
 )
-set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities libraries"
+set_package_properties(KF6Activities PROPERTIES DESCRIPTION "KActivities libraries"
                        URL "https://www.kde.org"
                        TYPE OPTIONAL
                        PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
@@ -111,31 +112,31 @@ if(PackageKitQt${QT_MAJOR_VERSION}_FOUND)
     set(HAVE_PACKAGEKIT TRUE)
 endif()
 
-find_package(KF5Baloo ${KF5_MIN_VERSION})
-set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
+find_package(KF6Baloo ${KF6_MIN_VERSION})
+set_package_properties(KF6Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
                        URL "https://www.kde.org"
                        TYPE OPTIONAL
                        PURPOSE "For adding desktop-wide search and tagging support to dolphin"
                       )
 
-find_package(KF5BalooWidgets 19.07.70)
-set_package_properties(KF5BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
+find_package(KF6BalooWidgets ${RELEASE_SERVICE_VERSION})
+set_package_properties(KF6BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
                        URL "https://www.kde.org"
                        TYPE OPTIONAL
                       )
 
-find_package(KF5FileMetaData ${KF5_MIN_VERSION})
-set_package_properties(KF5FileMetaData PROPERTIES
+find_package(KF6FileMetaData ${KF6_MIN_VERSION})
+set_package_properties(KF6FileMetaData PROPERTIES
                        URL "https://projects.kde.org/kfilemetadata"
                        TYPE OPTIONAL
                        PURPOSE "For accessing file metadata labels"
                       )
 
-if (KF5Activities_FOUND)
+if (KF6Activities_FOUND)
     set(HAVE_KACTIVITIES TRUE)
 endif()
 
-if (KF5Baloo_FOUND AND KF5BalooWidgets_FOUND AND KF5FileMetaData_FOUND)
+if (KF6Baloo_FOUND AND KF6BalooWidgets_FOUND AND KF6FileMetaData_FOUND)
     message(STATUS "Baloo packages are found")
     set(HAVE_BALOO TRUE)
 else()
@@ -149,12 +150,6 @@ else()
     set(HAVE_TERMINAL TRUE)
 endif()
 
-ecm_set_disabled_deprecation_versions(
-    QT 5.15
-    KF 5.90
-    KSERVICE 5.89 # We use KServiceTypeTrader in a compat code path
-)
-
 add_subdirectory(src)
 add_subdirectory(doc)
 
@@ -211,7 +206,7 @@ ecm_qt_install_logging_categories(
         )
 
 ki18n_install(po)
-if(KF5DocTools_FOUND)
+if(KF6DocTools_FOUND)
     kdoctools_install(po)
 endif()
 
index b6e3d42f60954025b58d83c214622b98bff1ffbe..c73d093ed4a4e58be97e25015382ebe2bf9ed779 100644 (file)
@@ -3,6 +3,6 @@
 include(CMakeFindDependencyMacro)
 
 find_dependency(Qt@QT_MAJOR_VERSION@Widgets)
-find_dependency(KF5KIO)
+find_dependency(KF6KIO)
 
 include("${CMAKE_CURRENT_LIST_DIR}/DolphinVcsTargets.cmake")
index 934f7a9ff4a9e74c38041977e3c6ca52243d099f..7527bbfa9a7ea8d15ab4f0a8e721a033fa8d93ef 100644 (file)
@@ -1,4 +1,4 @@
 
-if (KF5DocTools_FOUND)
+if (KF6DocTools_FOUND)
     kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR dolphin)
 endif()
index 62c70ba79abd3f8d1d5f280af003a74490a86969..5a481e39ff4b4e89ff3f87ebb3f1c4f74bffd0b6 100644 (file)
@@ -39,6 +39,7 @@ ecm_generate_headers(dolphinvcs_LIB_HEADERS
     RELATIVE "views/versioncontrol"
     REQUIRED_HEADERS dolphinvcs_LIB_HEADERS
 )
+target_include_directories(dolphinvcs INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}>")
 
 install(TARGETS dolphinvcs EXPORT DolphinVcsTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 
@@ -196,28 +197,30 @@ target_link_libraries(
     dolphinvcs
     Qt${QT_MAJOR_VERSION}::Concurrent
     Qt${QT_MAJOR_VERSION}::Gui
-    KF5::I18n
-    KF5::IconThemes
-    KF5::KIOCore
-    KF5::KIOWidgets
-    KF5::KIOFileWidgets
-    KF5::Completion
-    KF5::TextWidgets
-    KF5::ConfigCore
-    KF5::NewStuff
-    KF5::NewStuffWidgets    # KNSWidgets::Button
-    KF5::Parts
-    KF5::WindowSystem
-    KF5::WidgetsAddons
-    KF5::Codecs
+    KF6::I18n
+    KF6::IconThemes
+    KF6::KIOCore
+    KF6::KIOWidgets
+    KF6::KIOFileWidgets
+    KF6::Completion
+    KF6::TextWidgets
+    KF6::ConfigCore
+    KF6::NewStuffWidgets    # KNSWidgets::Button
+    KF6::Parts
+    KF6::WindowSystem
+    KF6::WidgetsAddons
+    KF6::Codecs
+    KF6::KCMUtils
+
+    KF6::MoreTools
 )
 
 if(HAVE_BALOO)
     target_link_libraries(
         dolphinprivate PUBLIC
-        KF5::FileMetaData
-        KF5::Baloo
-        KF5::BalooWidgets
+        KF6::FileMetaData
+        KF6::Baloo
+        KF6::BalooWidgets
     )
 endif()
 
@@ -289,7 +292,6 @@ target_sources(dolphinstatic PRIVATE
     selectionmode/bottombarcontentscontainer.cpp
     selectionmode/topbar.cpp
     settings/general/behaviorsettingspage.cpp
-    settings/general/configurepreviewplugindialog.cpp
     settings/general/confirmationssettingspage.cpp
     settings/general/generalsettingspage.cpp
     settings/general/previewssettingspage.cpp
@@ -298,7 +300,6 @@ target_sources(dolphinstatic PRIVATE
     settings/navigation/navigationsettingspage.cpp
     settings/contextmenu/contextmenusettingspage.cpp
     settings/settingspagebase.cpp
-    settings/serviceitemdelegate.cpp
     settings/servicemodel.cpp
     settings/startup/startupsettingspage.cpp
     settings/trash/trashsettingspage.cpp
@@ -349,7 +350,6 @@ target_sources(dolphinstatic PRIVATE
     selectionmode/bottombarcontentscontainer.h
     selectionmode/topbar.h
     settings/general/behaviorsettingspage.h
-    settings/general/configurepreviewplugindialog.h
     settings/general/confirmationssettingspage.h
     settings/general/generalsettingspage.h
     settings/general/previewssettingspage.h
@@ -358,7 +358,6 @@ target_sources(dolphinstatic PRIVATE
     settings/navigation/navigationsettingspage.h
     settings/contextmenu/contextmenusettingspage.h
     settings/settingspagebase.h
-    settings/serviceitemdelegate.h
     settings/servicemodel.h
     settings/startup/startupsettingspage.h
     settings/trash/trashsettingspage.h
@@ -431,25 +430,25 @@ target_sources(dolphinstatic PRIVATE
 target_include_directories(dolphinstatic SYSTEM PRIVATE ${PHONON_INCLUDES})
 target_link_libraries(dolphinstatic
     dolphinprivate
-    KF5::CoreAddons
-    KF5::KCMUtils
-    KF5::DBusAddons
-    KF5::Notifications
+    KF6::CoreAddons
+    KF6::KCMUtils
+    KF6::DBusAddons
+    KF6::Notifications
     Phonon::phonon4qt${QT_MAJOR_VERSION}
 )
 
 if (HAVE_KACTIVITIES)
     target_link_libraries(
         dolphinstatic
-        KF5::Activities
+        KF6::Activities
     )
 endif()
 
 if (HAVE_KUSERFEEDBACK)
     target_link_libraries(
         dolphinstatic
-        KUserFeedbackCore
-        KUserFeedbackWidgets
+        KUserFeedbackCoreQt6
+        KUserFeedbackWidgetsQt6
     )
 endif()
 
@@ -473,12 +472,12 @@ target_link_libraries(dolphin
     PRIVATE
     dolphinprivate
     dolphinstatic
-    KF5::Crash
+    KF6::Crash
 )
 
 if (HAVE_X11)
     if (QT_MAJOR_VERSION STREQUAL "5")
-        target_link_libraries(dolphin PRIVATE Qt5::X11Extras)
+        target_link_libraries(dolphin PRIVATE Qt{QT_MAJOR_VERSION}::X11Extras)
     else()
         target_link_libraries(dolphin PRIVATE Qt::GuiPrivate)
     endif()
@@ -528,18 +527,14 @@ if(NOT WIN32)
         settings/kcm/kcmdolphingeneral.cpp
         settings/general/behaviorsettingspage.cpp
         settings/general/previewssettingspage.cpp
-        settings/general/configurepreviewplugindialog.cpp
         settings/general/confirmationssettingspage.cpp
         settings/settingspagebase.cpp
-        settings/serviceitemdelegate.cpp
         settings/servicemodel.cpp
         settings/kcm/kcmdolphingeneral.h
         settings/general/behaviorsettingspage.h
         settings/general/previewssettingspage.h
-        settings/general/configurepreviewplugindialog.h
         settings/general/confirmationssettingspage.h
         settings/settingspagebase.h
-        settings/serviceitemdelegate.h
         settings/servicemodel.h
     )
 
index 445d3928644109dc46b60ecbf466a6761662cee2..e1c7b7ad2f83d3bfb31c11c4b608f0f18e248b12 100644 (file)
@@ -29,7 +29,6 @@
 #include <KLocalizedString>
 #include <KNewFileMenu>
 #include <KStandardAction>
-#include <kio_version.h>
 
 #include <QApplication>
 #include <QClipboard>
@@ -169,13 +168,9 @@ void DolphinContextMenu::addDirectoryItemContextMenu()
     addOpenWithActions();
 
     // set up 'Create New' menu
-    DolphinNewFileMenu *newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow);
+    DolphinNewFileMenu *newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection()->action(QStringLiteral("create_dir")), m_mainWindow);
     newFileMenu->checkUpToDate();
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
     newFileMenu->setWorkingDirectory(m_fileInfo.url());
-#else
-    newFileMenu->setPopupFiles(QList<QUrl>() << m_fileInfo.url());
-#endif
     newFileMenu->setEnabled(selectedItemsProps.supportsWriting());
     connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
     connect(newFileMenu, &DolphinNewFileMenu::directoryCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
@@ -281,11 +276,7 @@ void DolphinContextMenu::addViewportContextMenu()
     // Set up and insert 'Create New' menu
     KNewFileMenu *newFileMenu = m_mainWindow->newFileMenu();
     newFileMenu->checkUpToDate();
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
     newFileMenu->setWorkingDirectory(m_baseUrl);
-#else
-    newFileMenu->setPopupFiles(QList<QUrl>() << m_baseUrl);
-#endif
     addMenu(newFileMenu->menu());
 
     // Show "open with" menu items even if the dir is empty, because there are legitimate
index 2baaa1198c9789cad1d2cd8dda2687266ac3834c..13cc5e1cb5946b4579c11d8bd71fef4515cfbe7a 100644 (file)
 #include <KDualAction>
 #include <KFileItemListProperties>
 #include <KIO/CommandLauncherJob>
-#include <kio_version.h>
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
 #include <KIO/JobUiDelegateFactory>
-#else
-#include <KIO/JobUiDelegate>
-#endif
 #include <KIO/OpenFileManagerWindowJob>
 #include <KIO/OpenUrlJob>
 #include <KJobWidgets>
@@ -59,7 +54,6 @@
 #include <KShell>
 #include <KShortcutsDialog>
 #include <KStandardAction>
-#include <KStartupInfo>
 #include <KSycoca>
 #include <KTerminalLauncherJob>
 #include <KToggleAction>
@@ -70,7 +64,6 @@
 #include <KWindowSystem>
 #include <KXMLGUIFactory>
 
-#include <kio_version.h>
 #include <kwidgetsaddons_version.h>
 
 #include <QApplication>
 
 #include <algorithm>
 
+#if HAVE_X11
+#include <KStartupInfo>
+#endif
+
 namespace
 {
 // Used for GeneralSettings::version() to determine whether
@@ -165,6 +162,9 @@ DolphinMainWindow::DolphinMainWindow()
     connect(m_actionHandler, &DolphinViewActionHandler::createDirectoryTriggered, this, &DolphinMainWindow::createDirectory);
     connect(m_actionHandler, &DolphinViewActionHandler::selectionModeChangeTriggered, this, &DolphinMainWindow::slotSetSelectionMode);
 
+    Q_CHECK_PTR(actionCollection()->action(QStringLiteral("create_dir")));
+    m_newFileMenu->setNewFolderShortcutAction(actionCollection()->action(QStringLiteral("create_dir")));
+
     m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
     connect(this, &DolphinMainWindow::urlChanged, m_remoteEncoding, &DolphinRemoteEncoding::slotAboutToOpenUrl);
 
@@ -283,8 +283,10 @@ void DolphinMainWindow::activateWindow(const QString &activationToken)
 
     if (KWindowSystem::isPlatformWayland()) {
         KWindowSystem::setCurrentXdgActivationToken(activationToken);
-    } else {
+    } else if (KWindowSystem::isPlatformX11()) {
+#if HAVE_X11
         KStartupInfo::setNewStartupId(window()->windowHandle(), activationToken.toUtf8());
+#endif
     }
 
     KWindowSystem::activateWindow(window()->windowHandle());
@@ -509,7 +511,7 @@ void DolphinMainWindow::showTarget()
     const KFileItem link = m_activeViewContainer->view()->selectedItems().at(0);
     const QUrl destinationUrl = link.url().resolved(QUrl(link.linkDest()));
 
-    auto job = KIO::statDetails(destinationUrl, KIO::StatJob::SourceSide, KIO::StatNoDetails);
+    auto job = KIO::stat(destinationUrl, KIO::StatJob::SourceSide, KIO::StatNoDetails);
 
     connect(job, &KJob::finished, this, [this, destinationUrl](KJob *job) {
         KIO::StatJob *statJob = static_cast<KIO::StatJob *>(job);
@@ -676,20 +678,12 @@ void DolphinMainWindow::readProperties(const KConfigGroup &group)
 void DolphinMainWindow::updateNewMenu()
 {
     m_newFileMenu->checkUpToDate();
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
     m_newFileMenu->setWorkingDirectory(activeViewContainer()->url());
-#else
-    m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url());
-#endif
 }
 
 void DolphinMainWindow::createDirectory()
 {
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
     m_newFileMenu->setWorkingDirectory(activeViewContainer()->url());
-#else
-    m_newFileMenu->setPopupFiles(QList<QUrl>() << activeViewContainer()->url());
-#endif
     m_newFileMenu->createDirectory();
 }
 
@@ -1264,11 +1258,7 @@ void DolphinMainWindow::handleUrl(const QUrl &url)
         activeViewContainer()->setUrl(url);
     } else {
         m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url);
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
         m_lastHandleUrlOpenJob->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
-#else
-        m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
-#endif
         m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true);
 
         connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this, [this, url](const QString &mimetype) {
@@ -1542,7 +1532,8 @@ void DolphinMainWindow::setupActions()
     auto hamburgerMenuAction = KStandardAction::hamburgerMenu(nullptr, nullptr, actionCollection());
 
     // setup 'File' menu
-    m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
+    m_newFileMenu = new DolphinNewFileMenu(nullptr, this);
+    actionCollection()->addAction(QStringLiteral("new_menu"), m_newFileMenu);
     QMenu *menu = m_newFileMenu->menu();
     menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
     menu->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
@@ -2481,6 +2472,7 @@ void DolphinMainWindow::createPanelAction(const QIcon &icon, const QKeySequence
     panelAction->setText(dockAction->text());
     panelAction->setIcon(icon);
     dockAction->setIcon(icon);
+    dockAction->setEnabled(true);
     actionCollection()->setDefaultShortcut(panelAction, shortcut);
 
     connect(panelAction, &QAction::triggered, dockAction, &QAction::trigger);
index cadfbe9412ce4542c6d5de47effad8122a2605b2..7dc44f59db8904c115659070de4057256d3039fa 100644 (file)
@@ -42,7 +42,7 @@ DolphinNavigatorsWidgetAction::DolphinNavigatorsWidgetAction(QWidget *parent)
 
 void DolphinNavigatorsWidgetAction::adjustSpacing()
 {
-    m_previousWindowWidth = parentWidget()->window()->width();
+    m_previousWindowWidth = qobject_cast<QWidget *>(parent())->window()->width();
     auto viewGeometries = m_viewGeometriesHelper.viewGeometries();
     const int widthOfSplitterPrimary = viewGeometries.globalXOfPrimary + viewGeometries.widthOfPrimary - viewGeometries.globalXOfNavigatorsWidget;
     const QList<int> splitterSizes = {widthOfSplitterPrimary, m_splitter->width() - widthOfSplitterPrimary};
@@ -298,7 +298,7 @@ DolphinNavigatorsWidgetAction::ViewGeometriesHelper::ViewGeometriesHelper(QWidge
 bool DolphinNavigatorsWidgetAction::ViewGeometriesHelper::eventFilter(QObject *watched, QEvent *event)
 {
     if (event->type() == QEvent::Resize) {
-        if (m_navigatorsWidgetAction->parentWidget()->window()->width() != m_navigatorsWidgetAction->m_previousWindowWidth) {
+        if (qobject_cast<QWidget*>(m_navigatorsWidgetAction->parent())->window()->width() != m_navigatorsWidgetAction->m_previousWindowWidth) {
             // The window is being resized which means not all widgets have gotten their new sizes yet.
             // Let's wait a bit so the sizes of the navigatorsWidget and the viewContainers have all
             // had a chance to be updated.
index ec2f19d6e8818685b699aad76763b8c7d4ca313d..a64cf3def966207181535a555bcd60a65059382f 100644 (file)
@@ -8,12 +8,14 @@
 
 #include "views/dolphinnewfilemenuobserver.h"
 
-#include <KActionCollection>
 #include <KIO/Job>
 
-DolphinNewFileMenu::DolphinNewFileMenu(KActionCollection *collection, QObject *parent)
-    : KNewFileMenu(collection, QStringLiteral("new_menu"), parent)
+#include <QAction>
+
+DolphinNewFileMenu::DolphinNewFileMenu(QAction *createDirAction, QObject *parent)
+    : KNewFileMenu(parent)
 {
+    setNewFolderShortcutAction(createDirAction);
     DolphinNewFileMenuObserver::instance().attach(this);
 }
 
index 4fa173ef9dce8d6906f78c9ca67cb73e60fa887f..5538c92659ee8c9ff187e4ba3f4817818fd744cc 100644 (file)
@@ -25,7 +25,7 @@ class DOLPHIN_EXPORT DolphinNewFileMenu : public KNewFileMenu
     Q_OBJECT
 
 public:
-    DolphinNewFileMenu(KActionCollection *collection, QObject *parent);
+    DolphinNewFileMenu(QAction *createDirAction, QObject *parent);
     ~DolphinNewFileMenu() override;
 
 Q_SIGNALS:
index f8da1c353dc02869fc379b99483474b56c47f70b..a3856de6a6a03eb79a4ce578ea121e9950315582 100644 (file)
@@ -33,7 +33,6 @@
 #include <KPluginMetaData>
 #include <KSharedConfig>
 #include <KTerminalLauncherJob>
-#include <kio_version.h>
 
 #include <QActionGroup>
 #include <QApplication>
 #include <QStandardPaths>
 #include <QTextDocument>
 
+#include <KPluginFactory>
+
 K_PLUGIN_CLASS_WITH_JSON(DolphinPart, "dolphinpart.json")
 
 DolphinPart::DolphinPart(QWidget *parentWidget, QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
-    : KParts::ReadOnlyPart(parent)
+    : KParts::ReadOnlyPart(parent, metaData)
     , m_openTerminalAction(nullptr)
     , m_removeAction(nullptr)
 {
     Q_UNUSED(args)
-    setMetaData(metaData);
 
     m_extension = new DolphinPartBrowserExtension(this);
 
@@ -85,7 +85,7 @@ DolphinPart::DolphinPart(QWidget *parentWidget, QObject *parent, const KPluginMe
     });
     connect(m_view, &DolphinView::tabRequested, this, &DolphinPart::createNewWindow);
     connect(m_view, &DolphinView::requestContextMenu, this, &DolphinPart::slotOpenContextMenu);
-    connect(m_view, &DolphinView::selectionChanged, m_extension, &KParts::BrowserExtension::selectionInfo);
+    connect(m_view, &DolphinView::selectionChanged, m_extension, &KParts::NavigationExtension::selectionInfo);
     connect(m_view, &DolphinView::selectionChanged, this, &DolphinPart::slotSelectionChanged);
     connect(m_view, &DolphinView::requestItemInfo, this, &DolphinPart::slotRequestItemInfo);
     connect(m_view, &DolphinView::modeChanged, this, &DolphinPart::viewModeChanged); // relay signal
@@ -141,7 +141,7 @@ void DolphinPart::createActions()
 {
     // Edit menu
 
-    m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
+    m_newFileMenu = new DolphinNewFileMenu(actionCollection()->action(QStringLiteral("create_dir")), this);
     m_newFileMenu->setParentWidget(widget());
     connect(m_newFileMenu->menu(), &QMenu::aboutToShow, this, &DolphinPart::updateNewMenu);
 
@@ -362,8 +362,8 @@ void DolphinPart::createNewWindow(const QUrl &url)
 
 void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item, const KFileItemList &selectedItems, const QUrl &)
 {
-    KParts::BrowserExtension::PopupFlags popupFlags =
-        KParts::BrowserExtension::DefaultPopupItems | KParts::BrowserExtension::ShowProperties | KParts::BrowserExtension::ShowUrlOperations;
+    KParts::NavigationExtension::PopupFlags popupFlags =
+        KParts::NavigationExtension::DefaultPopupItems | KParts::NavigationExtension::ShowProperties | KParts::NavigationExtension::ShowUrlOperations;
 
     KFileItem item(_item);
 
@@ -384,7 +384,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item,
 
     KFileItemListProperties capabilities(items);
 
-    KParts::BrowserExtension::ActionGroupMap actionGroups;
+    KParts::NavigationExtension::ActionGroupMap actionGroups;
     QList<QAction *> editActions;
     editActions += m_view->versionControlActions(m_view->selectedItems());
 
@@ -409,7 +409,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item,
                 m_removeAction->update();
             }
         } else {
-            popupFlags |= KParts::BrowserExtension::NoDeletion;
+            popupFlags |= KParts::NavigationExtension::NoDeletion;
         }
 
         if (supportsMoving) {
@@ -420,7 +420,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item,
         // since otherwise the created file would not be visible.
         // But in treeview mode we should allow it.
         if (m_view->itemsExpandable())
-            popupFlags |= KParts::BrowserExtension::ShowCreateDirectory;
+            popupFlags |= KParts::NavigationExtension::ShowCreateDirectory;
     }
 
     actionGroups.insert(QStringLiteral("editactions"), editActions);
@@ -548,11 +548,7 @@ void DolphinPart::updateNewMenu()
     // As requested by KNewFileMenu :
     m_newFileMenu->checkUpToDate();
     // And set the files that the menu apply on :
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
     m_newFileMenu->setWorkingDirectory(url());
-#else
-    m_newFileMenu->setPopupFiles(QList<QUrl>() << url());
-#endif
 }
 
 void DolphinPart::updateStatusBar()
@@ -567,11 +563,7 @@ void DolphinPart::updateProgress(int percent)
 
 void DolphinPart::createDirectory()
 {
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
     m_newFileMenu->setWorkingDirectory(url());
-#else
-    m_newFileMenu->setPopupFiles(QList<QUrl>() << url());
-#endif
     m_newFileMenu->createDirectory();
 }
 
index 0bb016ea9d72039d35e75ef675e4d9a3516e841c..5d48454858ce857a7d2e6ad5d36d37a93b37fc73 100644 (file)
 #include "views/dolphinview.h"
 
 DolphinPartBrowserExtension::DolphinPartBrowserExtension(DolphinPart *part)
-    : KParts::BrowserExtension(part)
+    : KParts::NavigationExtension(part)
     , m_part(part)
 {
 }
 
 void DolphinPartBrowserExtension::restoreState(QDataStream &stream)
 {
-    KParts::BrowserExtension::restoreState(stream);
+    KParts::NavigationExtension::restoreState(stream);
     m_part->view()->restoreState(stream);
 }
 
 void DolphinPartBrowserExtension::saveState(QDataStream &stream)
 {
-    KParts::BrowserExtension::saveState(stream);
+    KParts::NavigationExtension::saveState(stream);
     m_part->view()->saveState(stream);
 }
 
index 615f14252aa59e66522876554a91356f207b08fc..7f8792fbb2135b1a0e6808737fed302354f92a7c 100644 (file)
@@ -7,16 +7,16 @@
 #ifndef DOLPHINPART_EXT_H
 #define DOLPHINPART_EXT_H
 
-#include <kparts/browserextension.h>
-#include <kparts/fileinfoextension.h>
-#include <kparts/listingfilterextension.h>
-#include <kparts/listingnotificationextension.h>
+#include <KParts/FileInfoExtension>
+#include <KParts/ListingFilterExtension>
+#include <KParts/ListingNotificationExtension>
+#include <KParts/NavigationExtension>
 
 #include <QUrl>
 
 class DolphinPart;
 
-class DolphinPartBrowserExtension : public KParts::BrowserExtension
+class DolphinPartBrowserExtension : public KParts::NavigationExtension
 {
     Q_OBJECT
 public:
index a7799a669c3e3e84765db6996512543d3a79bbb1..c70089223da4a6b62525c46e6f0c1f7673ee742f 100644 (file)
@@ -32,7 +32,7 @@ DolphinTabBar::DolphinTabBar(QWidget *parent)
 void DolphinTabBar::dragEnterEvent(QDragEnterEvent *event)
 {
     const QMimeData *mimeData = event->mimeData();
-    const int index = tabAt(event->pos());
+    const int index = tabAt(event->position().toPoint());
 
     if (mimeData->hasUrls()) {
         event->acceptProposedAction();
@@ -52,7 +52,7 @@ void DolphinTabBar::dragLeaveEvent(QDragLeaveEvent *event)
 void DolphinTabBar::dragMoveEvent(QDragMoveEvent *event)
 {
     const QMimeData *mimeData = event->mimeData();
-    const int index = tabAt(event->pos());
+    const int index = tabAt(event->position().toPoint());
 
     if (mimeData->hasUrls()) {
         updateAutoActivationTimer(index);
@@ -67,7 +67,7 @@ void DolphinTabBar::dropEvent(QDropEvent *event)
     updateAutoActivationTimer(-1);
 
     const QMimeData *mimeData = event->mimeData();
-    const int index = tabAt(event->pos());
+    const int index = tabAt(event->position().toPoint());
 
     if (mimeData->hasUrls()) {
         Q_EMIT tabDropEvent(index, event);
index 03f09ca86810378cad5cc52abb395fab54f1eb11..ff2f246aeda85846127d77fef7dccaef08efc6d3 100644 (file)
@@ -392,7 +392,7 @@ void DolphinTabWidget::tabDropEvent(int index, QDropEvent *event)
         const auto urls = event->mimeData()->urls();
 
         for (const QUrl &url : urls) {
-            auto *job = KIO::statDetails(url, KIO::StatJob::SourceSide, KIO::StatDetail::StatBasic, KIO::JobFlag::HideProgressInfo);
+            auto *job = KIO::stat(url, KIO::StatJob::SourceSide, KIO::StatDetail::StatBasic, KIO::JobFlag::HideProgressInfo);
             connect(job, &KJob::result, this, [this, job]() {
                 if (!job->error() && job->statResult().isDir()) {
                     openNewTab(job->url(), QUrl(), NewTabPosition::AtEnd);
index 03e49985c1dfeb1b9dca6ee7bd7c38f419e39b8f..1199da6c50e587afc6540ea5e8d8d2e41a60a1e3 100644 (file)
 #endif
 #include <KFileItemActions>
 #include <KFilePlacesModel>
-#include <kio_version.h>
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
 #include <KIO/JobUiDelegateFactory>
-#else
-#include <KIO/JobUiDelegate>
-#endif
 #include <KIO/OpenUrlJob>
 #include <KLocalizedString>
 #include <KMessageWidget>
@@ -729,11 +724,7 @@ void DolphinViewContainer::slotItemActivated(const KFileItem &item)
     }
 
     KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl(), item.mimetype());
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
     job->setUiDelegate(KIO::createDefaultJobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
-#else
-    job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
-#endif
     job->setShowOpenOrExecuteDialog(true);
     connect(job, &KIO::OpenUrlJob::finished, this, &DolphinViewContainer::slotOpenUrlFinished);
     job->start();
index bbe725dfd308cb66f3024980df121eb781771eeb..b71a4325b86bf951331bf449df5fb34604931cf1 100644 (file)
@@ -17,7 +17,6 @@
 #include <KIO/Job>
 #include <KLocalizedString>
 #include <KUrlMimeData>
-#include <kio_version.h>
 
 #include <QElapsedTimer>
 #include <QIcon>
@@ -263,11 +262,7 @@ void KFileItemModel::setShowTrashMime(bool show)
 
 void KFileItemModel::setShowHiddenFiles(bool show)
 {
-#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
-    m_dirLister->setShowingDotFiles(show);
-#else
     m_dirLister->setShowHiddenFiles(show);
-#endif
     setShowTrashMime(show);
     m_dirLister->emitChanges();
     if (show) {
@@ -277,11 +272,7 @@ void KFileItemModel::setShowHiddenFiles(bool show)
 
 bool KFileItemModel::showHiddenFiles() const
 {
-#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
-    return m_dirLister->showingDotFiles();
-#else
     return m_dirLister->showHiddenFiles();
-#endif
 }
 
 void KFileItemModel::setShowDirectoriesOnly(bool enabled)
@@ -624,9 +615,7 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
 
         m_expandedDirs.remove(targetUrl);
         m_dirLister->stop(url);
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 92, 0)
         m_dirLister->forgetDirs(url);
-#endif
 
         const int parentLevel = expandedParentsCount(index);
         const int itemCount = m_itemData.count();
@@ -642,9 +631,7 @@ bool KFileItemModel::setExpanded(int index, bool expanded)
                 const QUrl url = itemData->item.url();
                 m_expandedDirs.remove(targetUrl);
                 m_dirLister->stop(url); // TODO: try to unit-test this, see https://bugs.kde.org/show_bug.cgi?id=332102#c11
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 92, 0)
                 m_dirLister->forgetDirs(url);
-#endif
                 expandedChildren.append(targetUrl);
             }
             ++childIndex;
@@ -2606,7 +2593,7 @@ QList<QPair<int, QVariant>> KFileItemModel::permissionRoleGroups() const
         if (info.permission(QFile::ExeUser)) {
             user += i18nc("@item:intext Access permission, concatenated", "Execute, ");
         }
-        user = user.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : user.mid(0, user.count() - 2);
+        user = user.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : user.mid(0, user.length() - 2);
 
         // Set group string
         QString group;
@@ -2619,7 +2606,7 @@ QList<QPair<int, QVariant>> KFileItemModel::permissionRoleGroups() const
         if (info.permission(QFile::ExeGroup)) {
             group += i18nc("@item:intext Access permission, concatenated", "Execute, ");
         }
-        group = group.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : group.mid(0, group.count() - 2);
+        group = group.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : group.mid(0, group.length() - 2);
 
         // Set others string
         QString others;
@@ -2632,7 +2619,7 @@ QList<QPair<int, QVariant>> KFileItemModel::permissionRoleGroups() const
         if (info.permission(QFile::ExeOther)) {
             others += i18nc("@item:intext Access permission, concatenated", "Execute, ");
         }
-        others = others.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : others.mid(0, others.count() - 2);
+        others = others.isEmpty() ? i18nc("@item:intext Access permission, concatenated", "Forbidden") : others.mid(0, others.length() - 2);
 
         const QString newGroupValue = i18nc("@title:group Files and folders by permissions", "User: %1 | Group: %2 | Others: %3", user, group, others);
         if (newGroupValue != groupValue) {
index bd4bd7e519b8f99d80259d9e785a965912f14ea8..eeb1f20634302f30d8ebbee517144fd00d51643c 100644 (file)
@@ -119,8 +119,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel *model, QO
     m_directoryContentsCounter = new KDirectoryContentsCounter(m_model, this);
     connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result, this, &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived);
 
-    const QString pluginNamespace = QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/overlayicon");
-    const auto plugins = KPluginMetaData::findPlugins(pluginNamespace, {}, KPluginMetaData::AllowEmptyMetaData);
+    const auto plugins = KPluginMetaData::findPlugins(QStringLiteral("kf6/overlayicon"), {}, KPluginMetaData::AllowEmptyMetaData);
     for (const KPluginMetaData &data : plugins) {
         auto instance = QPluginLoader(data.fileName()).instance();
         auto plugin = qobject_cast<KOverlayIconPlugin *>(instance);
index 4cf36eb2da241bd07538f1ea105d7a6bbd928d45..d0632e2c56144c1e565cd6d675be480342d1f4d0 100644 (file)
@@ -112,7 +112,7 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File &f
             });
             values.insert(role, propertyInfo.formatAsDisplayString(list));
         } else {
-            if (propertyInfo.valueType() == QVariant::DateTime) {
+            if (propertyInfo.valueType() == QMetaType::Type::QDateTime) {
                 // Let dolphin format later Dates
                 values.insert(role, (*rangeBegin).second);
             } else {
index e063ca85eabce99b981d8a26856ec0eca92673a2..419d174e90ace364d9fc432534dbe8f64a43a69c 100644 (file)
@@ -13,7 +13,7 @@
 #include <KConfigGroup>
 #include <KFileItemListProperties>
 #include <KIO/CopyJob>
-#include <KIO/DeleteJob>
+#include <KIO/DeleteOrTrashJob>
 #include <KIO/Paste>
 #include <KIO/PasteJob>
 #include <KJobWidgets>
 #include <KSharedConfig>
 #include <KUrlMimeData>
 
-#include <kio_version.h>
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
-#include <KIO/DeleteOrTrashJob>
-#else
-#include <KIO/FileUndoManager>
-#include <KIO/JobUiDelegate>
-#endif
-
 #include <QApplication>
 #include <QClipboard>
 #include <QMenu>
@@ -197,39 +189,16 @@ void TreeViewContextMenu::rename()
 
 void TreeViewContextMenu::moveToTrash()
 {
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
     using Iface = KIO::AskUserActionInterface;
     auto *deleteJob = new KIO::DeleteOrTrashJob(QList{m_fileItem.url()}, Iface::Trash, Iface::DefaultConfirmation, m_parent);
     deleteJob->start();
-#else
-    const QList<QUrl> list{m_fileItem.url()};
-    KIO::JobUiDelegate uiDelegate;
-    uiDelegate.setWindow(m_parent);
-    if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) {
-        KIO::Job *job = KIO::trash(list);
-        KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl(QStringLiteral("trash:/")), job);
-        KJobWidgets::setWindow(job, m_parent);
-        job->uiDelegate()->setAutoErrorHandlingEnabled(true);
-    }
-#endif
 }
 
 void TreeViewContextMenu::deleteItem()
 {
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
     using Iface = KIO::AskUserActionInterface;
     auto *deleteJob = new KIO::DeleteOrTrashJob(QList{m_fileItem.url()}, Iface::Delete, Iface::DefaultConfirmation, m_parent);
     deleteJob->start();
-#else
-    const QList<QUrl> list{m_fileItem.url()};
-    KIO::JobUiDelegate uiDelegate;
-    uiDelegate.setWindow(m_parent);
-    if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
-        KIO::Job *job = KIO::del(list);
-        KJobWidgets::setWindow(job, m_parent);
-        job->uiDelegate()->setAutoErrorHandlingEnabled(true);
-    }
-#endif
 }
 
 void TreeViewContextMenu::showProperties()
index 7367f1d13f548d36c3edb537e6ac78c0ac838277..9d1e5b97195e7092974778dcb5df019e8784bc8e 100644 (file)
@@ -244,7 +244,7 @@ void InformationPanel::showItemInfo()
         // No item is hovered and no selection has been done: provide
         // an item for the currently shown directory.
         m_shownUrl = url();
-        m_folderStatJob = KIO::statDetails(m_shownUrl, KIO::StatJob::SourceSide, KIO::StatDefaultDetails | KIO::StatRecursiveSize, KIO::HideProgressInfo);
+        m_folderStatJob = KIO::stat(m_shownUrl, KIO::StatJob::SourceSide, KIO::StatDefaultDetails | KIO::StatRecursiveSize, KIO::HideProgressInfo);
         if (m_folderStatJob->uiDelegate()) {
             KJobWidgets::setWindow(m_folderStatJob, this);
         }
index d93457b2701f216ce884ed91e1d11e83af110e03..62f25b24bf3cdaf3e32c6f3986415e19afee71ed 100644 (file)
@@ -23,8 +23,8 @@
 
 #include <Baloo/FileMetaDataWidget>
 
-#include <Phonon/BackendCapabilities>
-#include <Phonon/MediaObject>
+#include <phonon/BackendCapabilities>
+#include <phonon/MediaObject>
 
 #include <QDialogButtonBox>
 #include <QGesture>
index 77d55da8bdc9122995370fdbdd210db1b66c4c99..3365998f4845249dc13d2e6c6ccad1eb3621a991 100644 (file)
@@ -7,10 +7,10 @@
 #include "phononwidget.h"
 
 #include <KLocalizedString>
-#include <Phonon/AudioOutput>
-#include <Phonon/MediaObject>
-#include <Phonon/SeekSlider>
-#include <Phonon/VideoWidget>
+#include <phonon/AudioOutput>
+#include <phonon/MediaObject>
+#include <phonon/SeekSlider>
+#include <phonon/VideoWidget>
 
 #include <QShowEvent>
 #include <QStyle>
index 4662e47af321c4cda1e4ba6ba0446731cbfe7cbf..a0a913b4fac746d47353848e4349be972893efb8 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef PHONONWIDGET_H
 #define PHONONWIDGET_H
 
-#include <Phonon/Global>
+#include <phonon/Global>
 
 #include <QSize>
 #include <QUrl>
index 3c3f7bb87a449d8df1e3e736f52b90cdc8c2f2d8..8b245f0e72a2c16ab5caa8fa6e75fa2b1de90af4 100644 (file)
@@ -141,7 +141,7 @@ static bool isInternalDrag(const QMimeData *mimeData)
 
 void PlacesPanel::dragMoveEvent(QDragMoveEvent *event)
 {
-    const QModelIndex index = indexAt(event->pos());
+    const QModelIndex index = indexAt(event->position().toPoint());
     if (index.isValid()) {
         auto *placesModel = static_cast<KFilePlacesModel *>(model());
 
index 06ad89547188dab9216ffe07934c769a05d4cb64..ac395d09df601350740532a0f811f988535feea9 100644 (file)
@@ -140,7 +140,7 @@ void TerminalPanel::showEvent(QShowEvent *event)
 
     if (!m_terminal) {
         m_clearTerminal = true;
-        KPluginFactory *factory = KPluginFactory::loadFactory(KPluginMetaData(QStringLiteral("konsolepart"))).plugin;
+        KPluginFactory *factory = KPluginFactory::loadFactory(KPluginMetaData(QStringLiteral("kf6/parts/konsolepart"))).plugin;
         m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : nullptr;
         if (m_konsolePart) {
             connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
index 03e55ba3272b7649fb3cb86d077447123e181ef4..eeaf3c168773d924bf45b28d2051712d6d29ecc4 100644 (file)
@@ -10,7 +10,6 @@
 #include "dolphin_generalsettings.h"
 #include "dolphin_versioncontrolsettings.h"
 #include "global.h"
-#include "settings/serviceitemdelegate.h"
 #include "settings/servicemodel.h"
 
 #include <KDesktopFile>
@@ -20,8 +19,6 @@
 #include <KMessageBox>
 #include <KPluginMetaData>
 #include <KService>
-#include <KServiceTypeTrader>
-#include <kio_version.h>
 #include <kiocore_export.h>
 #include <kservice_export.h>
 #include <kwidgetsaddons_version.h>
@@ -74,7 +71,6 @@ ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget *parent, const KActionC
     m_listView = new QListView(this);
     QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
 
-    auto *delegate = new ServiceItemDelegate(m_listView, m_listView);
     m_serviceModel = new ServiceModel(this);
     m_sortModel = new QSortFilterProxyModel(this);
     m_sortModel->setSourceModel(m_serviceModel);
@@ -83,7 +79,6 @@ ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget *parent, const KActionC
     m_sortModel->setFilterRole(Qt::DisplayRole);
     m_sortModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
     m_listView->setModel(m_sortModel);
-    m_listView->setItemDelegate(delegate);
     m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
     connect(m_listView, &QListView::clicked, this, &ContextMenuSettingsPage::changed);
 
@@ -177,7 +172,7 @@ void ContextMenuSettingsPage::applySettings()
     for (int i = 0; i < model->rowCount(); ++i) {
         const QModelIndex index = model->index(i, 0);
         const QString service = model->data(index, ServiceModel::DesktopEntryNameRole).toString();
-        const bool checked = model->data(index, Qt::CheckStateRole).toBool();
+        const bool checked = model->data(index, Qt::CheckStateRole).value<Qt::CheckState>() == Qt::Checked;
 
         if (service.startsWith(VersionControlServicePrefix)) {
             if (checked) {
@@ -242,7 +237,7 @@ void ContextMenuSettingsPage::restoreDefaults()
 
         const bool checked =
             !service.startsWith(VersionControlServicePrefix) && service != QLatin1String(DeleteService) && service != QLatin1String(CopyToMoveToService);
-        model->setData(index, checked, Qt::CheckStateRole);
+        model->setData(index, checked ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
     }
 }
 
@@ -269,7 +264,7 @@ void ContextMenuSettingsPage::showEvent(QShowEvent *event)
             for (const QString &id : m_actionIds) {
                 const QAction *action = m_actions->action(id);
                 if (action) {
-                    addRow(action->icon().name(), action->text(), id, entryVisible(id));
+                    addRow(action->icon().name(), KLocalizedString::removeAcceleratorMarker(action->text()), id, entryVisible(id));
                 }
             }
         }
@@ -290,13 +285,6 @@ void ContextMenuSettingsPage::loadServices()
     const auto locations = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kio/servicemenus"), QStandardPaths::LocateDirectory);
     QStringList files = KFileUtils::findAllUniqueFiles(locations);
 
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 90)
-    const KService::List services = KServiceTypeTrader::self()->query(QStringLiteral("KonqPopupMenu/Plugin"));
-    for (const KService::Ptr &service : services) {
-        files << QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kservices5/" % service->entryPath());
-    }
-#endif
-
     for (const auto &file : qAsConst(files)) {
         const QList<KServiceAction> serviceActions = KDesktopFileActions::userDefinedServices(KService(file), true);
 
@@ -315,20 +303,8 @@ void ContextMenuSettingsPage::loadServices()
         }
     }
 
-    // Load service plugins, this is deprecated in KIO 5.82
-#if KIOCORE_BUILD_DEPRECATED_SINCE(5, 82)
-    const KService::List pluginServices = KServiceTypeTrader::self()->query(QStringLiteral("KFileItemAction/Plugin"));
-    for (const KService::Ptr &service : pluginServices) {
-        const QString desktopEntryName = service->desktopEntryName();
-        if (!isInServicesList(desktopEntryName)) {
-            const bool checked = showGroup.readEntry(desktopEntryName, true);
-            addRow(service->icon(), service->name(), desktopEntryName, checked);
-        }
-    }
-#endif
-
     // Load JSON-based plugins that implement the KFileItemActionPlugin interface
-    const auto jsonPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/kfileitemaction"));
+    const auto jsonPlugins = KPluginMetaData::findPlugins(QStringLiteral("kf6/kfileitemaction"));
 
     for (const auto &jsonMetadata : jsonPlugins) {
         const QString desktopEntryName = jsonMetadata.pluginId();
@@ -378,7 +354,7 @@ void ContextMenuSettingsPage::addRow(const QString &icon, const QString &text, c
     m_serviceModel->setData(index, icon, Qt::DecorationRole);
     m_serviceModel->setData(index, text, Qt::DisplayRole);
     m_serviceModel->setData(index, value, ServiceModel::DesktopEntryNameRole);
-    m_serviceModel->setData(index, checked, Qt::CheckStateRole);
+    m_serviceModel->setData(index, checked ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
 }
 
 #include "moc_contextmenusettingspage.cpp"
index 74576ad207868b4f6573012665497754205e64a0..603e5c2e51970e9e456786e9c3feb3dddaf2fedf 100644 (file)
@@ -5,8 +5,8 @@ add_executable(servicemenuinstaller servicemenuinstaller.cpp)
 target_link_libraries(servicemenuinstaller PRIVATE
     Qt${QT_MAJOR_VERSION}::Core
     Qt${QT_MAJOR_VERSION}::Gui
-    KF5::I18n
-    KF5::CoreAddons
+    KF6::I18n
+    KF6::CoreAddons
 )
 
 if(HAVE_PACKAGEKIT)
diff --git a/src/settings/general/configurepreviewplugindialog.cpp b/src/settings/general/configurepreviewplugindialog.cpp
deleted file mode 100644 (file)
index 8846d82..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "configurepreviewplugindialog.h"
-
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-
-#include <KIO/DeleteJob>
-#include <KIO/JobUiDelegate>
-#include <KIO/ThumbCreator>
-#include <KJobWidgets>
-#include <KLocalizedString>
-#include <QPluginLoader>
-
-#include <QDialogButtonBox>
-#include <QPushButton>
-#include <QStandardPaths>
-#include <QUrl>
-#include <QVBoxLayout>
-
-ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString &pluginName, const QString &desktopEntryName, QWidget *parent)
-    : QDialog(parent)
-{
-    QSharedPointer<ThumbCreator> previewPlugin;
-    const QString pluginPath = QPluginLoader(desktopEntryName).fileName();
-    if (!pluginPath.isEmpty()) {
-        newCreator create = (newCreator)QLibrary::resolve(pluginPath, "new_creator");
-        if (create) {
-            previewPlugin.reset(dynamic_cast<ThumbCreator *>(create()));
-        }
-    }
-
-    setWindowTitle(i18nc("@title:window", "Configure Preview for %1", pluginName));
-    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
-    setMinimumWidth(400);
-
-    auto layout = new QVBoxLayout(this);
-
-    if (previewPlugin) {
-        auto configurationWidget = previewPlugin->createConfigurationWidget();
-        configurationWidget->setParent(this);
-        layout->addWidget(configurationWidget);
-
-        layout->addStretch();
-
-        connect(this, &ConfigurePreviewPluginDialog::accepted, this, [=] {
-            // TODO: It would be great having a mechanism to tell PreviewJob that only previews
-            // for a specific MIME-type should be regenerated. As this is not available yet we
-            // delete the whole thumbnails directory.
-            previewPlugin->writeConfiguration(configurationWidget);
-
-            // https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DIRECTORY
-            const QString thumbnailsPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/thumbnails/");
-            KIO::del(QUrl::fromLocalFile(thumbnailsPath), KIO::HideProgressInfo);
-        });
-    }
-
-    auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
-    connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfigurePreviewPluginDialog::accept);
-    connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfigurePreviewPluginDialog::reject);
-    layout->addWidget(buttonBox);
-
-    auto okButton = buttonBox->button(QDialogButtonBox::Ok);
-    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
-    okButton->setDefault(true);
-}
-
-#include "moc_configurepreviewplugindialog.cpp"
-
-#endif // KIO_VERSION
diff --git a/src/settings/general/configurepreviewplugindialog.h b/src/settings/general/configurepreviewplugindialog.h
deleted file mode 100644 (file)
index 66504cc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#ifndef CONFIGUREPREVIEWPLUGINDIALOG_H
-#define CONFIGUREPREVIEWPLUGINDIALOG_H
-
-#include <kiowidgets_export.h>
-
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-
-#include <QDialog>
-
-/**
- * @brief Dialog for configuring preview-plugins.
- */
-class ConfigurePreviewPluginDialog : public QDialog
-{
-    Q_OBJECT
-
-public:
-    /**
-     * @param pluginName       User visible name of the plugin
-     * @param desktopEntryName The name of the plugin that is noted in the desktopentry.
-     *                         Is used to instantiate the plugin to get the configuration
-     *                         widget.
-     * @param parent           Parent widget.
-     */
-    ConfigurePreviewPluginDialog(const QString &pluginName, const QString &desktopEntryName, QWidget *parent);
-    ~ConfigurePreviewPluginDialog() override = default;
-};
-#endif // KIOWIDGETS_BUILD_DEPRECATED_SINCE
-
-#endif
index ef98d0f8d368b82f304de7c3f02bb7ebd1846503..dd1ce942e076ee94898addf935e2ce2b94dad308 100644 (file)
@@ -6,9 +6,7 @@
 
 #include "previewssettingspage.h"
 
-#include "configurepreviewplugindialog.h"
 #include "dolphin_generalsettings.h"
-#include "settings/serviceitemdelegate.h"
 #include "settings/servicemodel.h"
 
 #include <KIO/PreviewJob>
@@ -45,12 +43,6 @@ PreviewsSettingsPage::PreviewsSettingsPage(QWidget *parent)
     m_listView = new QListView(this);
     QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
 
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-    ServiceItemDelegate *delegate = new ServiceItemDelegate(m_listView, m_listView);
-    connect(delegate, &ServiceItemDelegate::requestServiceConfiguration, this, &PreviewsSettingsPage::configureService);
-    m_listView->setItemDelegate(delegate);
-#endif
-
     ServiceModel *serviceModel = new ServiceModel(this);
     QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
     proxyModel->setSourceModel(serviceModel);
@@ -111,7 +103,7 @@ void PreviewsSettingsPage::applySettings()
         m_enabledPreviewPlugins.clear();
         for (int i = 0; i < rowCount; ++i) {
             const QModelIndex index = model->index(i, 0);
-            const bool checked = model->data(index, Qt::CheckStateRole).toBool();
+            const bool checked = model->data(index, Qt::CheckStateRole).value<Qt::CheckState>() == Qt::Checked;
             if (checked) {
                 const QString enabledPlugin = model->data(index, Qt::UserRole).toString();
                 m_enabledPreviewPlugins.append(enabledPlugin);
@@ -150,19 +142,6 @@ void PreviewsSettingsPage::showEvent(QShowEvent *event)
     SettingsPageBase::showEvent(event);
 }
 
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-void PreviewsSettingsPage::configureService(const QModelIndex &index)
-{
-    const QAbstractItemModel *model = index.model();
-    const QString pluginName = model->data(index).toString();
-    const QString desktopEntryName = model->data(index, ServiceModel::DesktopEntryNameRole).toString();
-
-    ConfigurePreviewPluginDialog *dialog = new ConfigurePreviewPluginDialog(pluginName, desktopEntryName, this);
-    dialog->setAttribute(Qt::WA_DeleteOnClose);
-    dialog->show();
-}
-#endif
-
 void PreviewsSettingsPage::loadPreviewPlugins()
 {
     QAbstractItemModel *model = m_listView->model();
@@ -173,14 +152,9 @@ void PreviewsSettingsPage::loadPreviewPlugins()
 
         model->insertRow(0);
         const QModelIndex index = model->index(0, 0);
-        model->setData(index, show, Qt::CheckStateRole);
+        model->setData(index, show ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
         model->setData(index, plugin.name(), Qt::DisplayRole);
         model->setData(index, plugin.pluginId(), ServiceModel::DesktopEntryNameRole);
-
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-        const bool configurable = plugin.value(QStringLiteral("Configurable"), false);
-        model->setData(index, configurable, ServiceModel::ConfigurableRole);
-#endif
     }
 
     model->sort(Qt::DisplayRole);
index 2c3e4dfeffd7ffd8dc9e711f72fc8d0db235c1b0..d6d22ae218d95dd2e63d025fc9878519b426443c 100644 (file)
@@ -40,9 +40,6 @@ protected:
     void showEvent(QShowEvent *event) override;
 
 private Q_SLOTS:
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-    void configureService(const QModelIndex &index);
-#endif
 
 private:
     void loadPreviewPlugins();
index c002da9262035ac3036ee7d22c46cdcebf4982da..efb9d40dba6c99472855b5d40e99aebefaa19ec4 100644 (file)
 
 K_PLUGIN_CLASS_WITH_JSON(DolphinGeneralConfigModule, "kcmdolphingeneral.json")
 
-DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget *parent, const QVariantList &args)
-    : KCModule(parent, args)
+DolphinGeneralConfigModule::DolphinGeneralConfigModule(QObject *parent, const KPluginMetaData &data)
+    : KCModule(parent, data)
     , m_pages()
 {
     setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
 
-    QVBoxLayout *topLayout = new QVBoxLayout(this);
+    QVBoxLayout *topLayout = new QVBoxLayout(widget());
     topLayout->setContentsMargins(0, 0, 0, 0);
 
-    QTabWidget *tabWidget = new QTabWidget(this);
+    QTabWidget *tabWidget = new QTabWidget(widget());
 
     // initialize 'Behavior' tab
     BehaviorSettingsPage *behaviorPage = new BehaviorSettingsPage(QUrl::fromLocalFile(QDir::homePath()), tabWidget);
index 889317738796c1ce93922cfeb12c41b2320116d5..828332539e0750dc2b9aec47a022339774112991 100644 (file)
@@ -21,7 +21,7 @@ class DolphinGeneralConfigModule : public KCModule
     Q_OBJECT
 
 public:
-    DolphinGeneralConfigModule(QWidget *parent, const QVariantList &args);
+    DolphinGeneralConfigModule(QObject *parent, const KPluginMetaData &data);
     ~DolphinGeneralConfigModule() override;
 
     void save() override;
index dd4756d8b115d5f000e55399e87879093bbcb9dc..6f699f82d57fdbb323a6cf392e6644754bd3089b 100644 (file)
 
 K_PLUGIN_CLASS_WITH_JSON(DolphinNavigationConfigModule, "kcmdolphinnavigation.json")
 
-DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget *parent, const QVariantList &args)
-    : KCModule(parent, args)
+DolphinNavigationConfigModule::DolphinNavigationConfigModule(QObject *parent)
+    : KCModule(parent)
     , m_navigation(nullptr)
 {
     setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
 
-    QVBoxLayout *topLayout = new QVBoxLayout(this);
+    QVBoxLayout *topLayout = new QVBoxLayout(widget());
     topLayout->setContentsMargins(0, 0, 0, 0);
 
-    m_navigation = new NavigationSettingsPage(this);
+    m_navigation = new NavigationSettingsPage(widget());
     connect(m_navigation, &NavigationSettingsPage::changed, this, &DolphinNavigationConfigModule::markAsChanged);
     topLayout->addWidget(m_navigation, 0, {});
 }
index 97d7bff85a15d5d3527c79f22933a18922fde947..a2540515597bf12066b4a2b32bc9427410600e78 100644 (file)
@@ -19,7 +19,7 @@ class DolphinNavigationConfigModule : public KCModule
     Q_OBJECT
 
 public:
-    DolphinNavigationConfigModule(QWidget *parent, const QVariantList &args);
+    DolphinNavigationConfigModule(QObject *parent);
     ~DolphinNavigationConfigModule() override;
 
     void save() override;
index 867faf69ed931d15d1de3611ca19fdad59b34644..41d12aa2c2dbc09523829cf564a88d2e184cc07b 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "settings/viewmodes/viewsettingstab.h"
 
+#include <KCModule>
 #include <KLocalizedString>
 #include <KPluginFactory>
 
 
 K_PLUGIN_CLASS_WITH_JSON(DolphinViewModesConfigModule, "kcmdolphinviewmodes.json")
 
-DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget *parent, const QVariantList &args)
-    : KCModule(parent, args)
+DolphinViewModesConfigModule::DolphinViewModesConfigModule(QObject *parent, const KPluginMetaData &data)
+    : KCModule(parent, data)
     , m_tabs()
 {
     setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
 
-    QVBoxLayout *topLayout = new QVBoxLayout(this);
+    QVBoxLayout *topLayout = new QVBoxLayout(widget());
     topLayout->setContentsMargins(0, 0, 0, 0);
 
-    QTabWidget *tabWidget = new QTabWidget(this);
+    QTabWidget *tabWidget = new QTabWidget(widget());
 
     // Initialize 'Icons' tab
     ViewSettingsTab *iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget);
index 33c0b77a520eb1902c08596635022befee047188..59cbca31414129ed3c06f3888cceb4aee1a7d9e3 100644 (file)
@@ -19,7 +19,7 @@ class DolphinViewModesConfigModule : public KCModule
     Q_OBJECT
 
 public:
-    DolphinViewModesConfigModule(QWidget *parent, const QVariantList &args);
+    DolphinViewModesConfigModule(QObject *parent, const KPluginMetaData &data);
     ~DolphinViewModesConfigModule() override;
 
     void save() override;
diff --git a/src/settings/serviceitemdelegate.cpp b/src/settings/serviceitemdelegate.cpp
deleted file mode 100644 (file)
index ea3a5fe..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "serviceitemdelegate.h"
-
-#include "servicemodel.h"
-
-#include <QAbstractItemView>
-#include <QCheckBox>
-#include <QPainter>
-#include <QPushButton>
-
-ServiceItemDelegate::ServiceItemDelegate(QAbstractItemView *itemView, QObject *parent)
-    : KWidgetItemDelegate(itemView, parent)
-{
-}
-
-ServiceItemDelegate::~ServiceItemDelegate()
-{
-}
-
-QSize ServiceItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
-{
-    Q_UNUSED(index)
-
-    const QStyle *style = itemView()->style();
-    const int buttonHeight = style->pixelMetric(QStyle::PM_ButtonMargin) * 2 + style->pixelMetric(QStyle::PM_ButtonIconSize);
-    const int fontHeight = option.fontMetrics.height();
-    return QSize(100, qMax(buttonHeight, fontHeight));
-}
-
-void ServiceItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
-{
-    Q_UNUSED(index)
-    painter->save();
-
-    itemView()->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, painter);
-
-    if (option.state & QStyle::State_Selected) {
-        painter->setPen(option.palette.highlightedText().color());
-    }
-
-    painter->restore();
-}
-
-QList<QWidget *> ServiceItemDelegate::createItemWidgets(const QModelIndex &) const
-{
-    QCheckBox *checkBox = new QCheckBox();
-    QPalette palette = checkBox->palette();
-    palette.setColor(QPalette::WindowText, palette.color(QPalette::Text));
-    checkBox->setPalette(palette);
-    connect(checkBox, &QCheckBox::clicked, this, &ServiceItemDelegate::slotCheckBoxClicked);
-
-    QPushButton *configureButton = new QPushButton();
-    connect(configureButton, &QPushButton::clicked, this, &ServiceItemDelegate::slotConfigureButtonClicked);
-
-    return {checkBox, configureButton};
-}
-
-void ServiceItemDelegate::updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
-{
-    QCheckBox *checkBox = static_cast<QCheckBox *>(widgets[0]);
-    QPushButton *configureButton = static_cast<QPushButton *>(widgets[1]);
-
-    const int itemHeight = sizeHint(option, index).height();
-
-    // Update the checkbox showing the service name and icon
-    const QAbstractItemModel *model = index.model();
-    checkBox->setText(model->data(index).toString());
-    const QString iconName = model->data(index, Qt::DecorationRole).toString();
-    if (!iconName.isEmpty()) {
-        checkBox->setIcon(QIcon::fromTheme(iconName));
-    }
-    checkBox->setChecked(model->data(index, Qt::CheckStateRole).toBool());
-
-    const bool configurable = model->data(index, ServiceModel::ConfigurableRole).toBool();
-
-    int checkBoxWidth = option.rect.width();
-    if (configurable) {
-        checkBoxWidth -= configureButton->sizeHint().width();
-    }
-    checkBox->resize(checkBoxWidth, checkBox->sizeHint().height());
-    checkBox->move(0, (itemHeight - checkBox->height()) / 2);
-
-    // Update the configuration button
-    if (configurable) {
-        configureButton->setEnabled(checkBox->isChecked());
-        configureButton->setIcon(QIcon::fromTheme(QStringLiteral("configure")));
-        configureButton->resize(configureButton->sizeHint());
-        configureButton->move(option.rect.right() - configureButton->width(), (itemHeight - configureButton->height()) / 2);
-    }
-    configureButton->setVisible(configurable);
-}
-
-void ServiceItemDelegate::slotCheckBoxClicked(bool checked)
-{
-    QAbstractItemModel *model = const_cast<QAbstractItemModel *>(focusedIndex().model());
-    model->setData(focusedIndex(), checked, Qt::CheckStateRole);
-}
-
-void ServiceItemDelegate::slotConfigureButtonClicked()
-{
-    Q_EMIT requestServiceConfiguration(focusedIndex());
-}
-
-#include "moc_serviceitemdelegate.cpp"
diff --git a/src/settings/serviceitemdelegate.h b/src/settings/serviceitemdelegate.h
deleted file mode 100644 (file)
index 74f7dfd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#ifndef SERVICEITEMDELEGATE_H
-#define SERVICEITEMDELEGATE_H
-
-#include <KWidgetItemDelegate>
-
-/**
- * @brief Widget item delegate for a service that can be enabled or disabled.
- *
- * Additionally it is possible to configure a service.
- * @see ServiceModel
- */
-class ServiceItemDelegate : public KWidgetItemDelegate
-{
-    Q_OBJECT
-
-public:
-    explicit ServiceItemDelegate(QAbstractItemView *itemView, QObject *parent = nullptr);
-    ~ServiceItemDelegate() override;
-
-    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
-
-    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
-
-    QList<QWidget *> createItemWidgets(const QModelIndex &) const override;
-
-    void updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const override;
-
-Q_SIGNALS:
-    void requestServiceConfiguration(const QModelIndex &index);
-
-private Q_SLOTS:
-    void slotCheckBoxClicked(bool checked);
-    void slotConfigureButtonClicked();
-};
-
-#endif
index 07a804e339bb269c284399387332ce417eda5fe1..c2ebda7c16338e74bb2b6c8932cca8abe30c9e1d 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "servicemodel.h"
 
+#include <QIcon>
+
 ServiceModel::ServiceModel(QObject *parent)
     : QAbstractListModel(parent)
     , m_items()
@@ -29,8 +31,7 @@ bool ServiceModel::insertRows(int row, int count, const QModelIndex &parent)
     beginInsertRows(parent, row, row + count - 1);
     for (int i = 0; i < count; ++i) {
         ServiceItem item;
-        item.checked = false;
-        item.configurable = false;
+        item.checked = Qt::Unchecked;
         m_items.insert(row, item);
     }
     endInsertRows();
@@ -47,10 +48,7 @@ bool ServiceModel::setData(const QModelIndex &index, const QVariant &value, int
 
     switch (role) {
     case Qt::CheckStateRole:
-        m_items[row].checked = value.toBool();
-        break;
-    case ConfigurableRole:
-        m_items[row].configurable = value.toBool();
+        m_items[row].checked = value.value<Qt::CheckState>();
         break;
     case Qt::DecorationRole:
         m_items[row].icon = value.toString();
@@ -74,12 +72,10 @@ QVariant ServiceModel::data(const QModelIndex &index, int role) const
     const int row = index.row();
     if (row < rowCount()) {
         switch (role) {
-        case ConfigurableRole:
-            return m_items[row].configurable;
         case Qt::CheckStateRole:
             return m_items[row].checked;
         case Qt::DecorationRole:
-            return m_items[row].icon;
+            return QIcon::fromTheme(m_items[row].icon);
         case Qt::DisplayRole:
             return m_items[row].text;
         case DesktopEntryNameRole:
@@ -105,4 +101,9 @@ void ServiceModel::clear()
     endRemoveRows();
 }
 
+Qt::ItemFlags ServiceModel::flags(const QModelIndex &index) const
+{
+    return QAbstractListModel::flags(index) | Qt::ItemIsUserCheckable;
+}
+
 #include "moc_servicemodel.cpp"
index 23c752e934ddd196b387892e5e4cc87875aa7566..0abe1fe46f339c060000ae696878b6cbc8d55d7b 100644 (file)
@@ -25,7 +25,7 @@ class ServiceModel : public QAbstractListModel
     Q_OBJECT
 
 public:
-    enum Role { DesktopEntryNameRole = Qt::UserRole, ConfigurableRole };
+    enum Role { DesktopEntryNameRole = Qt::UserRole };
 
     explicit ServiceModel(QObject *parent = nullptr);
     ~ServiceModel() override;
@@ -35,11 +35,11 @@ public:
     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
     void clear();
+    Qt::ItemFlags flags(const QModelIndex &index) const override;
 
 private:
     struct ServiceItem {
-        bool checked;
-        bool configurable;
+        Qt::CheckState checked;
         QString icon;
         QString text;
         QString desktopEntryName;
index dc15ee39a01b97df34a2306f65fba992b465a5e3..f92ead17956ab1b4056c77dc604ee4a167483ee2 100644 (file)
@@ -135,7 +135,7 @@ void StartupSettingsPage::applySettings()
 
     const QUrl url(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile));
     if (url.isValid() && KProtocolManager::supportsListing(url)) {
-        KIO::StatJob *job = KIO::statDetails(url, KIO::StatJob::SourceSide, KIO::StatDetail::StatBasic, KIO::JobFlag::HideProgressInfo);
+        KIO::StatJob *job = KIO::stat(url, KIO::StatJob::SourceSide, KIO::StatDetail::StatBasic, KIO::JobFlag::HideProgressInfo);
         connect(job, &KJob::result, this, [this, settings, url](KJob *job) {
             if (job->error() == 0 && qobject_cast<KIO::StatJob *>(job)->statResult().isDir()) {
                 settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile));
index 1920cd904cec99a6a5b348346905ff3dff6e8362..38a3d086581053d84a92f26df1aef6b4ac886778 100644 (file)
@@ -6,7 +6,8 @@
 
 #include "trashsettingspage.h"
 
-#include <KCModuleProxy>
+#include <KCModuleLoader>
+#include <KCModule>
 #include <KPluginMetaData>
 
 #include <QFormLayout>
@@ -16,12 +17,13 @@ TrashSettingsPage::TrashSettingsPage(QWidget *parent)
 {
     QFormLayout *topLayout = new QFormLayout(this);
 
-    m_proxy = new KCModuleProxy(KPluginMetaData(QStringLiteral("kcm_trash")));
-    topLayout->addRow(m_proxy);
+    m_kcm = KCModuleLoader::loadModule(KPluginMetaData(QStringLiteral("kcm_trash")));
+
+    topLayout->addRow(m_kcm->widget());
 
     loadSettings();
 
-    connect(m_proxy, &KCModuleProxy::changed, this, &TrashSettingsPage::changed);
+    connect(m_kcm, &KCModule::needsSaveChanged, this, &TrashSettingsPage::changed);
 }
 
 TrashSettingsPage::~TrashSettingsPage()
@@ -30,17 +32,17 @@ TrashSettingsPage::~TrashSettingsPage()
 
 void TrashSettingsPage::applySettings()
 {
-    m_proxy->save();
+    m_kcm->save();
 }
 
 void TrashSettingsPage::restoreDefaults()
 {
-    m_proxy->defaults();
+    m_kcm->defaults();
 }
 
 void TrashSettingsPage::loadSettings()
 {
-    m_proxy->load();
+    m_kcm->load();
 }
 
 #include "moc_trashsettingspage.cpp"
index b0e48a018defb506974af7cba4cb124c811493dc..a5253774cf43ff6dfa2a83bc0c9924bae10ac594 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "settings/settingspagebase.h"
 
-class KCModuleProxy;
+class KCModule;
 
 /**
  * @brief Tab page for the 'Trash' settings of the Dolphin settings dialog, it uses the KCM.
@@ -29,7 +29,7 @@ public:
 
 private:
     void loadSettings();
-    KCModuleProxy *m_proxy;
+    KCModule *m_kcm;
 };
 
 #endif
index 6c205acee8131d5b417790970c9125d05ac8f46d..7d87cb2fc6f2f176f19d94286e61839a664d9fdc 100644 (file)
@@ -7,8 +7,8 @@
 #include "userfeedbacksettingspage.h"
 #include "userfeedback/dolphinfeedbackprovider.h"
 
-#include <KUserFeedback/FeedbackConfigWidget>
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/FeedbackConfigWidget>
+#include <KUserFeedbackQt6/Provider>
 
 #include <QVBoxLayout>
 
index 8e0c6f11909a688d5df44b25590be5ccce4cf811..6431ff3fa9190b6f4c2b3feca040c6fd791e5c57 100644 (file)
@@ -43,14 +43,14 @@ target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt${QT_MAJOR_VERSIO
 ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
 
 # DolphinSearchBox
-if (KF5Baloo_FOUND)
+if (KF6Baloo_FOUND)
     ecm_add_test(dolphinsearchboxtest.cpp
     TEST_NAME dolphinsearchboxtest
     LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
 endif()
 
 # DolphinQuery
-if (KF5Baloo_FOUND)
+if (KF6Baloo_FOUND)
     ecm_add_test(dolphinquerytest.cpp
     TEST_NAME dolphinquerytest
     LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
index 38d2544aafa9434ad5a61955c154979a99dd0fc6..16189a0fc647199335723f7cc98d3d987782db5e 100644 (file)
@@ -14,7 +14,6 @@
 
 #include <KDirLister>
 #include <kio/job.h>
-#include <kio_version.h>
 
 #include "kitemviews/kfileitemmodel.h"
 #include "testdir.h"
@@ -2479,9 +2478,6 @@ void KFileItemModelTest::testInsertAfterExpand()
 
     // Insert additional files into "a/b/"
     m_testDir->createFile("a/b/2");
-#if KIO_VERSION < QT_VERSION_CHECK(5, 92, 0)
-    QEXPECT_FAIL("", "Requires new API from frameworks", Abort);
-#endif
 
     QVERIFY(!itemsInsertedSpy.wait(5000));
 
index b37a7430ddfc724c8851ef3338c1f80ff1255dd0..bbc9c579f40ad80a040a42d865c055005065f592 100644 (file)
@@ -9,17 +9,11 @@
 
 #include <KConfig>
 #include <KConfigGroup>
+#include <KIO/DeleteOrTrashJob>
 #include <KLocalizedString>
 #include <KNotification>
-#include <QList>
 
-#include <kio_version.h>
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
-#include <KIO/DeleteOrTrashJob>
-#else
-#include <KIO/JobUiDelegate>
-#include <KJobWidgets>
-#endif
+#include <QList>
 
 Trash::Trash()
     : m_trashDirLister(new KDirLister())
@@ -62,22 +56,10 @@ static void notifyEmptied()
 
 void Trash::empty(QWidget *window)
 {
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
     using Iface = KIO::AskUserActionInterface;
     auto *emptyJob = new KIO::DeleteOrTrashJob(QList<QUrl>{}, Iface::EmptyTrash, Iface::DefaultConfirmation, window);
     QObject::connect(emptyJob, &KIO::Job::result, notifyEmptied);
     emptyJob->start();
-#else
-    KIO::JobUiDelegate uiDelegate;
-    uiDelegate.setWindow(window);
-    bool confirmed = uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation);
-    if (confirmed) {
-        KIO::Job *job = KIO::emptyTrash();
-        KJobWidgets::setWindow(job, window);
-        job->uiDelegate()->setAutoErrorHandlingEnabled(true);
-        QObject::connect(job, &KIO::Job::result, notifyEmptied);
-    }
-#endif
 }
 
 bool Trash::isEmpty()
index 19526dc4d2429aa5ae959ed7b6046b72186e5960..f233fad462a37f491ea3312c6363269198320ca2 100644 (file)
@@ -8,13 +8,13 @@
 #include "placesdatasource.h"
 #include "settingsdatasource.h"
 
-#include <KUserFeedback/ApplicationVersionSource>
-#include <KUserFeedback/LocaleInfoSource>
-#include <KUserFeedback/PlatformInfoSource>
-#include <KUserFeedback/QtVersionSource>
-#include <KUserFeedback/ScreenInfoSource>
-#include <KUserFeedback/StartCountSource>
-#include <KUserFeedback/UsageTimeSource>
+#include <KUserFeedbackQt6/ApplicationVersionSource>
+#include <KUserFeedbackQt6/LocaleInfoSource>
+#include <KUserFeedbackQt6/PlatformInfoSource>
+#include <KUserFeedbackQt6/QtVersionSource>
+#include <KUserFeedbackQt6/ScreenInfoSource>
+#include <KUserFeedbackQt6/StartCountSource>
+#include <KUserFeedbackQt6/UsageTimeSource>
 
 DolphinFeedbackProvider *DolphinFeedbackProvider::instance()
 {
index 8be2f81b6fa1c4d2f1643617057401ad2871c699..3b85c7eb35c660cbc58f3db3bde86f1971c16417 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef DOLPHINFEEDBACKPROVIDER_H
 #define DOLPHINFEEDBACKPROVIDER_H
 
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/Provider>
 
 class DolphinFeedbackProvider : public KUserFeedback::Provider
 {
index cdbd5d7570aef0e52d9525f04e2b063e809e6f55..554194af75578996578da8d7f6fe817d450c87d9 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <KLocalizedString>
 #include <KMountPoint>
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/Provider>
 #include <Solid/Device>
 #include <Solid/NetworkShare>
 #include <Solid/StorageAccess>
index d4666af25f102d04e3e2ce620591a46439856d49..ad4c1725d6d32c3716c1d1d0fb7ff4d3773e6801 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef PLACESDATASOURCE_H
 #define PLACESDATASOURCE_H
 
-#include <KUserFeedback/AbstractDataSource>
+#include <KUserFeedbackQt6/AbstractDataSource>
 
 class DolphinMainWindow;
 
index c517793adbd083d41af0674cc1c71cb7ea5bd385..d14fc0dbd94e1a79ec06f7f8889940caf8764eb4 100644 (file)
@@ -9,7 +9,7 @@
 #include "dolphinmainwindow.h"
 
 #include <KLocalizedString>
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/Provider>
 
 #include <QApplication>
 #include <QVariant>
index 9804c78a790ea8e26a36eaa4a5d9e4d05c498736..cc843dec81c5a361010bfbf076d64d5e90ceef86 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef SETTINGSDATASOURCE_H
 #define SETTINGSDATASOURCE_H
 
-#include <KUserFeedback/AbstractDataSource>
+#include <KUserFeedbackQt6/AbstractDataSource>
 
 class DolphinMainWindow;
 
index 2881915ac1cf0624a9e51d5aa73dc9b6edc34795..32dd6bd29086929844623ddd0969389695292f90 100644 (file)
@@ -87,7 +87,7 @@ void DolphinRemoteEncoding::fillMenu()
     QMenu *menu = m_menu->menu();
     menu->clear();
 
-    menu->addAction(i18n("Default"), this, SLOT(slotDefault()), 0)->setCheckable(true);
+    menu->addAction(i18n("Default"), this, &DolphinRemoteEncoding::slotDefault)->setCheckable(true);
     for (int i = 0; i < m_encodingDescriptions.size(); i++) {
         QAction *action = new QAction(m_encodingDescriptions.at(i), this);
         action->setCheckable(true);
@@ -96,7 +96,7 @@ void DolphinRemoteEncoding::fillMenu()
     }
     menu->addSeparator();
 
-    menu->addAction(i18n("Reload"), this, SLOT(slotReload()), 0);
+    menu->addAction(i18n("Reload"), this, &DolphinRemoteEncoding::slotReload);
     m_idDefault = m_encodingDescriptions.size() + 2;
 
     connect(menu, &QMenu::triggered, this, &DolphinRemoteEncoding::slotItemSelected);
index 9666ca2ab38b1c6478da786dc04c63c1ff5be6fc..ebbf324b007d7e813aed9b2f861f81cf2faec5af 100644 (file)
@@ -35,7 +35,7 @@
 #include <KFileItemListProperties>
 #include <KFormat>
 #include <KIO/CopyJob>
-#include <KIO/DeleteJob>
+#include <KIO/DeleteOrTrashJob>
 #include <KIO/DropJob>
 #include <KIO/JobUiDelegate>
 #include <KIO/Paste>
 
 #include <kwidgetsaddons_version.h>
 
-#include <kio_version.h>
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
-#include <KIO/DeleteOrTrashJob>
-#endif
-
 #include <QAbstractItemView>
 #include <QActionGroup>
 #include <QApplication>
@@ -623,7 +618,7 @@ void DolphinView::requestStatusBarText()
             return;
         }
 
-        m_statJobForStatusBarText = KIO::statDetails(m_model->rootItem().url(), KIO::StatJob::SourceSide, KIO::StatRecursiveSize, KIO::HideProgressInfo);
+        m_statJobForStatusBarText = KIO::stat(m_model->rootItem().url(), KIO::StatJob::SourceSide, KIO::StatRecursiveSize, KIO::HideProgressInfo);
         connect(m_statJobForStatusBarText, &KJob::result, this, &DolphinView::slotStatJobResult);
         m_statJobForStatusBarText->start();
     }
@@ -757,43 +752,22 @@ void DolphinView::trashSelectedItems()
 {
     const QList<QUrl> list = simplifiedSelectedUrls();
 
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
     using Iface = KIO::AskUserActionInterface;
     auto *trashJob = new KIO::DeleteOrTrashJob(list, Iface::Trash, Iface::DefaultConfirmation, this);
     connect(trashJob, &KJob::result, this, &DolphinView::slotTrashFileFinished);
     m_selectNextItem = true;
     trashJob->start();
-#else
-    KIO::JobUiDelegate uiDelegate;
-    uiDelegate.setWindow(window());
-    if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) {
-        KIO::Job *job = KIO::trash(list);
-        KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, list, QUrl(QStringLiteral("trash:/")), job);
-        KJobWidgets::setWindow(job, this);
-        connect(job, &KIO::Job::result, this, &DolphinView::slotTrashFileFinished);
-    }
-#endif
 }
 
 void DolphinView::deleteSelectedItems()
 {
     const QList<QUrl> list = simplifiedSelectedUrls();
 
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
     using Iface = KIO::AskUserActionInterface;
     auto *trashJob = new KIO::DeleteOrTrashJob(list, Iface::Delete, Iface::DefaultConfirmation, this);
     connect(trashJob, &KJob::result, this, &DolphinView::slotTrashFileFinished);
     m_selectNextItem = true;
     trashJob->start();
-#else
-    KIO::JobUiDelegate uiDelegate;
-    uiDelegate.setWindow(window());
-    if (uiDelegate.askDeleteConfirmation(list, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) {
-        KIO::Job *job = KIO::del(list);
-        KJobWidgets::setWindow(job, this);
-        connect(job, &KIO::Job::result, this, &DolphinView::slotDeleteFileFinished);
-    }
-#endif
 }
 
 void DolphinView::cutSelectedItemsToClipboard()
index 7117e9e1b811d930efd5ade9b49318de5a2520bf..4408a9e4785a72e14643971b1c0ab448a462a94c 100644 (file)
@@ -215,7 +215,7 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac
     viewModeActions->addAction(compactAction);
     viewModeActions->addAction(detailsAction);
     viewModeActions->setToolBarMode(KSelectAction::MenuMode);
-    connect(viewModeActions, &KSelectAction::triggered, this, &DolphinViewActionHandler::slotViewModeActionTriggered);
+    connect(viewModeActions, &KSelectAction::actionTriggered, this, &DolphinViewActionHandler::slotViewModeActionTriggered);
 
     QAction *zoomInAction = KStandardAction::zoomIn(this, &DolphinViewActionHandler::zoomIn, m_actionCollection);
     zoomInAction->setWhatsThis(i18nc("@info:whatsthis zoom in", "This increases the icon size."));