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
# 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'
+ 'frameworks/baloo': '@latest-kf6'
'libraries/baloo-widgets': '@same'
'third-party/packagekit-qt': '@latest'
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)
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
endif()
endif()
-find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
+find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
KCMUtils
NewStuff
CoreAddons
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"
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 23.07.70)
+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()
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)
)
ki18n_install(po)
-if(KF5DocTools_FOUND)
+if(KF6DocTools_FOUND)
kdoctools_install(po)
endif()
include(CMakeFindDependencyMacro)
find_dependency(Qt@QT_MAJOR_VERSION@Widgets)
-find_dependency(KF5KIO)
+find_dependency(KF6KIO)
include("${CMAKE_CURRENT_LIST_DIR}/DolphinVcsTargets.cmake")
-if (KF5DocTools_FOUND)
+if (KF6DocTools_FOUND)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR dolphin)
endif()
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()
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
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
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()
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()
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/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
// set up 'Create New' menu
DolphinNewFileMenu *newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow);
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ newFileMenu->setNewFolderShortcutAction(m_mainWindow->actionCollection()->action("create_dir"));
+#endif
newFileMenu->checkUpToDate();
#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0)
newFileMenu->setWorkingDirectory(m_fileInfo.url());
connect(m_actionHandler, &DolphinViewActionHandler::createDirectoryTriggered, this, &DolphinMainWindow::createDirectory);
connect(m_actionHandler, &DolphinViewActionHandler::selectionModeChangeTriggered, this, &DolphinMainWindow::slotSetSelectionMode);
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ m_newFileMenu->setNewFolderShortcutAction(actionCollection()->action("create_dir"));
+#endif
+
m_remoteEncoding = new DolphinRemoteEncoding(this, m_actionHandler);
connect(this, &DolphinMainWindow::urlChanged, m_remoteEncoding, &DolphinRemoteEncoding::slotAboutToOpenUrl);
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};
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.
#include <KActionCollection>
#include <KIO/Job>
+#include <kio_version.h>
DolphinNewFileMenu::DolphinNewFileMenu(KActionCollection *collection, QObject *parent)
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ : KNewFileMenu(parent)
+{
+ Q_UNUSED(collection)
+#else
: KNewFileMenu(collection, QStringLiteral("new_menu"), parent)
{
+#endif
DolphinNewFileMenuObserver::instance().attach(this);
}
#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);
});
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
m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
m_newFileMenu->setParentWidget(widget());
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
+ m_newFileMenu->setNewFolderShortcutAction(actionCollection()->action("create_dir"));
+#endif
connect(m_newFileMenu->menu(), &QMenu::aboutToShow, this, &DolphinPart::updateNewMenu);
QAction *editMimeTypeAction = actionCollection()->addAction(QStringLiteral("editMimeType"));
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);
KFileItemListProperties capabilities(items);
- KParts::BrowserExtension::ActionGroupMap actionGroups;
+ KParts::NavigationExtension::ActionGroupMap actionGroups;
QList<QAction *> editActions;
editActions += m_view->versionControlActions(m_view->selectedItems());
m_removeAction->update();
}
} else {
- popupFlags |= KParts::BrowserExtension::NoDeletion;
+ popupFlags |= KParts::NavigationExtension::NoDeletion;
}
if (supportsMoving) {
// 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);
#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);
}
#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:
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();
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);
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);
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();
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());
#include <KMessageBox>
#include <KPluginMetaData>
#include <KService>
-#include <KServiceTypeTrader>
#include <kio_version.h>
#include <kiocore_export.h>
#include <kservice_export.h>
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);
}
}
- // 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();
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)
+++ /dev/null
-/*
- * 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);
-}
-
-#endif // KIO_VERSION
+++ /dev/null
-/*
- * 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
#include "previewssettingspage.h"
-#include "configurepreviewplugindialog.h"
#include "dolphin_generalsettings.h"
#include "settings/serviceitemdelegate.h"
#include "settings/servicemodel.h"
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);
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();
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);
void showEvent(QShowEvent *event) override;
private Q_SLOTS:
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
- void configureService(const QModelIndex &index);
-#endif
private:
void loadPreviewPlugins();
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(qobject_cast<QWidget *>(parent), data)
, m_pages()
{
setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
- QVBoxLayout *topLayout = new QVBoxLayout(this);
+ const auto parentWidget = qobject_cast<QWidget *>(parent);
+ QVBoxLayout *topLayout = new QVBoxLayout(parentWidget);
topLayout->setContentsMargins(0, 0, 0, 0);
- QTabWidget *tabWidget = new QTabWidget(this);
+ QTabWidget *tabWidget = new QTabWidget(parentWidget);
// initialize 'Behavior' tab
BehaviorSettingsPage *behaviorPage = new BehaviorSettingsPage(QUrl::fromLocalFile(QDir::homePath()), tabWidget);
Q_OBJECT
public:
- DolphinGeneralConfigModule(QWidget *parent, const QVariantList &args);
+ DolphinGeneralConfigModule(QObject *parent, const KPluginMetaData &data);
~DolphinGeneralConfigModule() override;
void save() override;
K_PLUGIN_CLASS_WITH_JSON(DolphinNavigationConfigModule, "kcmdolphinnavigation.json")
-DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget *parent, const QVariantList &args)
- : KCModule(parent, args)
+DolphinNavigationConfigModule::DolphinNavigationConfigModule(QObject *parent)
+ : KCModule(qobject_cast<QWidget *>(parent))
, m_navigation(nullptr)
{
setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
- QVBoxLayout *topLayout = new QVBoxLayout(this);
+ const auto parentWidget = qobject_cast<QWidget *>(parent);
+ QVBoxLayout *topLayout = new QVBoxLayout(parentWidget);
topLayout->setContentsMargins(0, 0, 0, 0);
- m_navigation = new NavigationSettingsPage(this);
+ m_navigation = new NavigationSettingsPage(parentWidget);
connect(m_navigation, &NavigationSettingsPage::changed, this, &DolphinNavigationConfigModule::markAsChanged);
topLayout->addWidget(m_navigation, 0, {});
}
Q_OBJECT
public:
- DolphinNavigationConfigModule(QWidget *parent, const QVariantList &args);
+ DolphinNavigationConfigModule(QObject *parent);
~DolphinNavigationConfigModule() override;
void save() override;
#include <KLocalizedString>
#include <KPluginFactory>
+#include <KCModule>
#include <QDBusConnection>
#include <QDBusMessage>
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(qobject_cast<QWidget *>(parent), data)
, m_tabs()
{
setButtons(KCModule::Default | KCModule::Help | KCModule::Apply);
- QVBoxLayout *topLayout = new QVBoxLayout(this);
+ const auto parentWidget = qobject_cast<QWidget *>(parent);
+ QVBoxLayout *topLayout = new QVBoxLayout(parentWidget);
topLayout->setContentsMargins(0, 0, 0, 0);
- QTabWidget *tabWidget = new QTabWidget(this);
+ QTabWidget *tabWidget = new QTabWidget(parentWidget);
// Initialize 'Icons' tab
ViewSettingsTab *iconsTab = new ViewSettingsTab(ViewSettingsTab::IconsMode, tabWidget);
Q_OBJECT
public:
- DolphinViewModesConfigModule(QWidget *parent, const QVariantList &args);
+ DolphinViewModesConfigModule(QObject *parent, const KPluginMetaData &data);
~DolphinViewModesConfigModule() override;
void save() override;
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]);
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);
#include "trashsettingspage.h"
-#include <KCModuleProxy>
+#include <KCModuleLoader>
+#include <KCModule>
#include <KPluginMetaData>
#include <QFormLayout>
{
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()
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 "settings/settingspagebase.h"
-class KCModuleProxy;
+class KCModule;
/**
* @brief Tab page for the 'Trash' settings of the Dolphin settings dialog, it uses the KCM.
private:
void loadSettings();
- KCModuleProxy *m_proxy;
+ KCModule *m_kcm;
};
#endif
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)
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."));