┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--.kde-ci.yml57
-rw-r--r--CMakeLists.txt51
-rw-r--r--DolphinVcsConfig.cmake.in2
-rw-r--r--doc/CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt59
-rw-r--r--src/dolphincontextmenu.cpp11
-rw-r--r--src/dolphinmainwindow.cpp35
-rw-r--r--src/dolphinnavigatorswidgetaction.cpp4
-rw-r--r--src/dolphinnewfilemenu.cpp8
-rw-r--r--src/dolphinnewfilemenu.h2
-rw-r--r--src/dolphinpart.cpp28
-rw-r--r--src/dolphinpart_ext.cpp6
-rw-r--r--src/dolphinpart_ext.h10
-rw-r--r--src/dolphintabbar.cpp6
-rw-r--r--src/dolphintabwidget.cpp2
-rw-r--r--src/dolphinviewcontainer.cpp9
-rw-r--r--src/kitemviews/kfileitemmodel.cpp19
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.cpp2
-rw-r--r--src/kitemviews/private/kbaloorolesprovider.cpp2
-rw-r--r--src/panels/folders/treeviewcontextmenu.cpp33
-rw-r--r--src/panels/information/informationpanel.cpp2
-rw-r--r--src/panels/information/informationpanelcontent.cpp4
-rw-r--r--src/panels/information/phononwidget.cpp8
-rw-r--r--src/panels/information/phononwidget.h2
-rw-r--r--src/panels/places/placespanel.cpp2
-rw-r--r--src/settings/contextmenu/contextmenusettingspage.cpp23
-rw-r--r--src/settings/contextmenu/servicemenuinstaller/CMakeLists.txt4
-rw-r--r--src/settings/general/configurepreviewplugindialog.cpp73
-rw-r--r--src/settings/general/configurepreviewplugindialog.h36
-rw-r--r--src/settings/general/previewssettingspage.cpp25
-rw-r--r--src/settings/general/previewssettingspage.h3
-rw-r--r--src/settings/kcm/kcmdolphingeneral.cpp8
-rw-r--r--src/settings/kcm/kcmdolphingeneral.h2
-rw-r--r--src/settings/kcm/kcmdolphinnavigation.cpp8
-rw-r--r--src/settings/kcm/kcmdolphinnavigation.h2
-rw-r--r--src/settings/kcm/kcmdolphinviewmodes.cpp9
-rw-r--r--src/settings/kcm/kcmdolphinviewmodes.h2
-rw-r--r--src/settings/serviceitemdelegate.cpp2
-rw-r--r--src/settings/serviceitemdelegate.h2
-rw-r--r--src/settings/startup/startupsettingspage.cpp2
-rw-r--r--src/settings/trash/trashsettingspage.cpp16
-rw-r--r--src/settings/trash/trashsettingspage.h4
-rw-r--r--src/settings/userfeedback/userfeedbacksettingspage.cpp4
-rw-r--r--src/tests/CMakeLists.txt4
-rw-r--r--src/tests/kfileitemmodeltest.cpp4
-rw-r--r--src/trash/dolphintrash.cpp22
-rw-r--r--src/userfeedback/dolphinfeedbackprovider.cpp14
-rw-r--r--src/userfeedback/dolphinfeedbackprovider.h2
-rw-r--r--src/userfeedback/placesdatasource.cpp2
-rw-r--r--src/userfeedback/placesdatasource.h2
-rw-r--r--src/userfeedback/settingsdatasource.cpp2
-rw-r--r--src/userfeedback/settingsdatasource.h2
-rw-r--r--src/views/dolphinremoteencoding.cpp4
-rw-r--r--src/views/dolphinview.cpp30
-rw-r--r--src/views/dolphinviewactionhandler.cpp2
56 files changed, 201 insertions, 486 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9b0962759..6c54587fa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
diff --git a/.kde-ci.yml b/.kde-ci.yml
index a3ecb8099..68e460d4c 100644
--- a/.kde-ci.yml
+++ b/.kde-ci.yml
@@ -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'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3fa91d8a2..6b712e70c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
diff --git a/DolphinVcsConfig.cmake.in b/DolphinVcsConfig.cmake.in
index b6e3d42f6..c73d093ed 100644
--- a/DolphinVcsConfig.cmake.in
+++ b/DolphinVcsConfig.cmake.in
@@ -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")
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 934f7a9ff..7527bbfa9 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,4 +1,4 @@
-if (KF5DocTools_FOUND)
+if (KF6DocTools_FOUND)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR dolphin)
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 62c70ba79..9cd4e2932 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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
@@ -349,7 +351,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
@@ -431,25 +432,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 +474,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,7 +529,6 @@ 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
@@ -536,7 +536,6 @@ if(NOT WIN32)
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
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 445d39286..e1c7b7ad2 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -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
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 2baaa1198..dbf0067d8 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -42,12 +42,7 @@
#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>
@@ -90,6 +83,10 @@
#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")));
diff --git a/src/dolphinnavigatorswidgetaction.cpp b/src/dolphinnavigatorswidgetaction.cpp
index cadfbe941..7dc44f59d 100644
--- a/src/dolphinnavigatorswidgetaction.cpp
+++ b/src/dolphinnavigatorswidgetaction.cpp
@@ -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.
diff --git a/src/dolphinnewfilemenu.cpp b/src/dolphinnewfilemenu.cpp
index ec2f19d6e..a64cf3def 100644
--- a/src/dolphinnewfilemenu.cpp
+++ b/src/dolphinnewfilemenu.cpp
@@ -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);
}
diff --git a/src/dolphinnewfilemenu.h b/src/dolphinnewfilemenu.h
index 4fa173ef9..5538c9265 100644
--- a/src/dolphinnewfilemenu.h
+++ b/src/dolphinnewfilemenu.h
@@ -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:
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp
index f8da1c353..a3856de6a 100644
--- a/src/dolphinpart.cpp
+++ b/src/dolphinpart.cpp
@@ -33,7 +33,6 @@
#include <KPluginMetaData>
#include <KSharedConfig>
#include <KTerminalLauncherJob>
-#include <kio_version.h>
#include <QActionGroup>
#include <QApplication>
@@ -46,15 +45,16 @@
#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();
}
diff --git a/src/dolphinpart_ext.cpp b/src/dolphinpart_ext.cpp
index 0bb016ea9..5d4845485 100644
--- a/src/dolphinpart_ext.cpp
+++ b/src/dolphinpart_ext.cpp
@@ -10,20 +10,20 @@
#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);
}
diff --git a/src/dolphinpart_ext.h b/src/dolphinpart_ext.h
index 615f14252..7f8792fbb 100644
--- a/src/dolphinpart_ext.h
+++ b/src/dolphinpart_ext.h
@@ -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:
diff --git a/src/dolphintabbar.cpp b/src/dolphintabbar.cpp
index a7799a669..c70089223 100644
--- a/src/dolphintabbar.cpp
+++ b/src/dolphintabbar.cpp
@@ -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);
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp
index 03f09ca86..ff2f246ae 100644
--- a/src/dolphintabwidget.cpp
+++ b/src/dolphintabwidget.cpp
@@ -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);
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 03e49985c..1199da6c5 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -25,12 +25,7 @@
#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();
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index bbe725dfd..b71a4325b 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -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) {
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp
index bd4bd7e51..6c660e952 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.cpp
+++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp
@@ -119,7 +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 QString pluginNamespace = QStringLiteral("kf" QT_STRINGIFY(QT_MAJOR_VERSION)) + QStringLiteral("/overlayicon");
const auto plugins = KPluginMetaData::findPlugins(pluginNamespace, {}, KPluginMetaData::AllowEmptyMetaData);
for (const KPluginMetaData &data : plugins) {
auto instance = QPluginLoader(data.fileName()).instance();
diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp
index 4cf36eb2d..d0632e2c5 100644
--- a/src/kitemviews/private/kbaloorolesprovider.cpp
+++ b/src/kitemviews/private/kbaloorolesprovider.cpp
@@ -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 {
diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp
index e063ca85e..419d174e9 100644
--- a/src/panels/folders/treeviewcontextmenu.cpp
+++ b/src/panels/folders/treeviewcontextmenu.cpp
@@ -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>
@@ -22,14 +22,6 @@
#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()
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp
index 7367f1d13..9d1e5b971 100644
--- a/src/panels/information/informationpanel.cpp
+++ b/src/panels/information/informationpanel.cpp
@@ -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);
}
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index d93457b27..62f25b24b 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -23,8 +23,8 @@
#include <Baloo/FileMetaDataWidget>
-#include <Phonon/BackendCapabilities>
-#include <Phonon/MediaObject>
+#include <phonon/BackendCapabilities>
+#include <phonon/MediaObject>
#include <QDialogButtonBox>
#include <QGesture>
diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp
index 77d55da8b..3365998f4 100644
--- a/src/panels/information/phononwidget.cpp
+++ b/src/panels/information/phononwidget.cpp
@@ -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>
diff --git a/src/panels/information/phononwidget.h b/src/panels/information/phononwidget.h
index 4662e47af..a0a913b4f 100644
--- a/src/panels/information/phononwidget.h
+++ b/src/panels/information/phononwidget.h
@@ -7,7 +7,7 @@
#ifndef PHONONWIDGET_H
#define PHONONWIDGET_H
-#include <Phonon/Global>
+#include <phonon/Global>
#include <QSize>
#include <QUrl>
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp
index 3c3f7bb87..8b245f0e7 100644
--- a/src/panels/places/placespanel.cpp
+++ b/src/panels/places/placespanel.cpp
@@ -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());
diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp
index 03e55ba32..01d396090 100644
--- a/src/settings/contextmenu/contextmenusettingspage.cpp
+++ b/src/settings/contextmenu/contextmenusettingspage.cpp
@@ -20,8 +20,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>
@@ -290,13 +288,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 +306,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("kf" QT_STRINGIFY(QT_MAJOR_VERSION)) + QStringLiteral("/kfileitemaction"));
for (const auto &jsonMetadata : jsonPlugins) {
const QString desktopEntryName = jsonMetadata.pluginId();
diff --git a/src/settings/contextmenu/servicemenuinstaller/CMakeLists.txt b/src/settings/contextmenu/servicemenuinstaller/CMakeLists.txt
index 74576ad20..603e5c2e5 100644
--- a/src/settings/contextmenu/servicemenuinstaller/CMakeLists.txt
+++ b/src/settings/contextmenu/servicemenuinstaller/CMakeLists.txt
@@ -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
index 8846d8261..000000000
--- a/src/settings/general/configurepreviewplugindialog.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <[email protected]>
- *
- * 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
index 66504cce2..000000000
--- a/src/settings/general/configurepreviewplugindialog.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <[email protected]>
- *
- * 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
diff --git a/src/settings/general/previewssettingspage.cpp b/src/settings/general/previewssettingspage.cpp
index ef98d0f8d..7c63e94ba 100644
--- a/src/settings/general/previewssettingspage.cpp
+++ b/src/settings/general/previewssettingspage.cpp
@@ -6,7 +6,6 @@
#include "previewssettingspage.h"
-#include "configurepreviewplugindialog.h"
#include "dolphin_generalsettings.h"
#include "settings/serviceitemdelegate.h"
#include "settings/servicemodel.h"
@@ -45,12 +44,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);
@@ -150,19 +143,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();
@@ -176,11 +156,6 @@ void PreviewsSettingsPage::loadPreviewPlugins()
model->setData(index, show, 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);
diff --git a/src/settings/general/previewssettingspage.h b/src/settings/general/previewssettingspage.h
index 2c3e4dfef..d6d22ae21 100644
--- a/src/settings/general/previewssettingspage.h
+++ b/src/settings/general/previewssettingspage.h
@@ -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();
diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp
index c002da926..efb9d40db 100644
--- a/src/settings/kcm/kcmdolphingeneral.cpp
+++ b/src/settings/kcm/kcmdolphingeneral.cpp
@@ -19,16 +19,16 @@
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);
diff --git a/src/settings/kcm/kcmdolphingeneral.h b/src/settings/kcm/kcmdolphingeneral.h
index 889317738..828332539 100644
--- a/src/settings/kcm/kcmdolphingeneral.h
+++ b/src/settings/kcm/kcmdolphingeneral.h
@@ -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;
diff --git a/src/settings/kcm/kcmdolphinnavigation.cpp b/src/settings/kcm/kcmdolphinnavigation.cpp
index dd4756d8b..6f699f82d 100644
--- a/src/settings/kcm/kcmdolphinnavigation.cpp
+++ b/src/settings/kcm/kcmdolphinnavigation.cpp
@@ -15,16 +15,16 @@
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, {});
}
diff --git a/src/settings/kcm/kcmdolphinnavigation.h b/src/settings/kcm/kcmdolphinnavigation.h
index 97d7bff85..a25405155 100644
--- a/src/settings/kcm/kcmdolphinnavigation.h
+++ b/src/settings/kcm/kcmdolphinnavigation.h
@@ -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;
diff --git a/src/settings/kcm/kcmdolphinviewmodes.cpp b/src/settings/kcm/kcmdolphinviewmodes.cpp
index 867faf69e..41d12aa2c 100644
--- a/src/settings/kcm/kcmdolphinviewmodes.cpp
+++ b/src/settings/kcm/kcmdolphinviewmodes.cpp
@@ -8,6 +8,7 @@
#include "settings/viewmodes/viewsettingstab.h"
+#include <KCModule>
#include <KLocalizedString>
#include <KPluginFactory>
@@ -19,16 +20,16 @@
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);
diff --git a/src/settings/kcm/kcmdolphinviewmodes.h b/src/settings/kcm/kcmdolphinviewmodes.h
index 33c0b77a5..59cbca314 100644
--- a/src/settings/kcm/kcmdolphinviewmodes.h
+++ b/src/settings/kcm/kcmdolphinviewmodes.h
@@ -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
index ea3a5fe52..97fafc631 100644
--- a/src/settings/serviceitemdelegate.cpp
+++ b/src/settings/serviceitemdelegate.cpp
@@ -60,7 +60,7 @@ QList<QWidget *> ServiceItemDelegate::createItemWidgets(const QModelIndex &) con
return {checkBox, configureButton};
}
-void ServiceItemDelegate::updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
+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]);
diff --git a/src/settings/serviceitemdelegate.h b/src/settings/serviceitemdelegate.h
index 74f7dfd6a..d7b243878 100644
--- a/src/settings/serviceitemdelegate.h
+++ b/src/settings/serviceitemdelegate.h
@@ -29,7 +29,7 @@ public:
QList<QWidget *> createItemWidgets(const QModelIndex &) const override;
- void updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const override;
+ void updateItemWidgets(const QList<QWidget *> &widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const override;
Q_SIGNALS:
void requestServiceConfiguration(const QModelIndex &index);
diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp
index dc15ee39a..f92ead179 100644
--- a/src/settings/startup/startupsettingspage.cpp
+++ b/src/settings/startup/startupsettingspage.cpp
@@ -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));
diff --git a/src/settings/trash/trashsettingspage.cpp b/src/settings/trash/trashsettingspage.cpp
index 1920cd904..38a3d0865 100644
--- a/src/settings/trash/trashsettingspage.cpp
+++ b/src/settings/trash/trashsettingspage.cpp
@@ -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"
diff --git a/src/settings/trash/trashsettingspage.h b/src/settings/trash/trashsettingspage.h
index b0e48a018..a5253774c 100644
--- a/src/settings/trash/trashsettingspage.h
+++ b/src/settings/trash/trashsettingspage.h
@@ -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
diff --git a/src/settings/userfeedback/userfeedbacksettingspage.cpp b/src/settings/userfeedback/userfeedbacksettingspage.cpp
index 6c205acee..7d87cb2fc 100644
--- a/src/settings/userfeedback/userfeedbacksettingspage.cpp
+++ b/src/settings/userfeedback/userfeedbacksettingspage.cpp
@@ -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>
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 8e0c6f119..6431ff3fa 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -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)
diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp
index 38d2544aa..16189a0fc 100644
--- a/src/tests/kfileitemmodeltest.cpp
+++ b/src/tests/kfileitemmodeltest.cpp
@@ -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));
diff --git a/src/trash/dolphintrash.cpp b/src/trash/dolphintrash.cpp
index b37a7430d..bbc9c579f 100644
--- a/src/trash/dolphintrash.cpp
+++ b/src/trash/dolphintrash.cpp
@@ -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()
diff --git a/src/userfeedback/dolphinfeedbackprovider.cpp b/src/userfeedback/dolphinfeedbackprovider.cpp
index 19526dc4d..f233fad46 100644
--- a/src/userfeedback/dolphinfeedbackprovider.cpp
+++ b/src/userfeedback/dolphinfeedbackprovider.cpp
@@ -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()
{
diff --git a/src/userfeedback/dolphinfeedbackprovider.h b/src/userfeedback/dolphinfeedbackprovider.h
index 8be2f81b6..3b85c7eb3 100644
--- a/src/userfeedback/dolphinfeedbackprovider.h
+++ b/src/userfeedback/dolphinfeedbackprovider.h
@@ -7,7 +7,7 @@
#ifndef DOLPHINFEEDBACKPROVIDER_H
#define DOLPHINFEEDBACKPROVIDER_H
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/Provider>
class DolphinFeedbackProvider : public KUserFeedback::Provider
{
diff --git a/src/userfeedback/placesdatasource.cpp b/src/userfeedback/placesdatasource.cpp
index cdbd5d757..554194af7 100644
--- a/src/userfeedback/placesdatasource.cpp
+++ b/src/userfeedback/placesdatasource.cpp
@@ -8,7 +8,7 @@
#include <KLocalizedString>
#include <KMountPoint>
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/Provider>
#include <Solid/Device>
#include <Solid/NetworkShare>
#include <Solid/StorageAccess>
diff --git a/src/userfeedback/placesdatasource.h b/src/userfeedback/placesdatasource.h
index d4666af25..ad4c1725d 100644
--- a/src/userfeedback/placesdatasource.h
+++ b/src/userfeedback/placesdatasource.h
@@ -7,7 +7,7 @@
#ifndef PLACESDATASOURCE_H
#define PLACESDATASOURCE_H
-#include <KUserFeedback/AbstractDataSource>
+#include <KUserFeedbackQt6/AbstractDataSource>
class DolphinMainWindow;
diff --git a/src/userfeedback/settingsdatasource.cpp b/src/userfeedback/settingsdatasource.cpp
index c517793ad..d14fc0dbd 100644
--- a/src/userfeedback/settingsdatasource.cpp
+++ b/src/userfeedback/settingsdatasource.cpp
@@ -9,7 +9,7 @@
#include "dolphinmainwindow.h"
#include <KLocalizedString>
-#include <KUserFeedback/Provider>
+#include <KUserFeedbackQt6/Provider>
#include <QApplication>
#include <QVariant>
diff --git a/src/userfeedback/settingsdatasource.h b/src/userfeedback/settingsdatasource.h
index 9804c78a7..cc843dec8 100644
--- a/src/userfeedback/settingsdatasource.h
+++ b/src/userfeedback/settingsdatasource.h
@@ -7,7 +7,7 @@
#ifndef SETTINGSDATASOURCE_H
#define SETTINGSDATASOURCE_H
-#include <KUserFeedback/AbstractDataSource>
+#include <KUserFeedbackQt6/AbstractDataSource>
class DolphinMainWindow;
diff --git a/src/views/dolphinremoteencoding.cpp b/src/views/dolphinremoteencoding.cpp
index 2881915ac..32dd6bd29 100644
--- a/src/views/dolphinremoteencoding.cpp
+++ b/src/views/dolphinremoteencoding.cpp
@@ -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);
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 9666ca2ab..ebbf324b0 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -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>
@@ -49,11 +49,6 @@
#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()
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp
index 7117e9e1b..4408a9e47 100644
--- a/src/views/dolphinviewactionhandler.cpp
+++ b/src/views/dolphinviewactionhandler.cpp
@@ -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."));