# 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'
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "23")
- set (RELEASE_SERVICE_VERSION_MINOR "03")
+ set (RELEASE_SERVICE_VERSION_MINOR "07")
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)
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()
// 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());
m_copyToMenu.addActionsTo(this);
}
+ if (m_mainWindow->isSplitViewEnabledInCurrentTab()) {
+ if (ContextMenuSettings::showCopyToOtherSplitView()) {
+ addAction(m_mainWindow->actionCollection()->action(QStringLiteral("copy_to_inactive_split_view")));
+ }
+
+ if (ContextMenuSettings::showMoveToOtherSplitView()) {
+ addAction(m_mainWindow->actionCollection()->action(QStringLiteral("move_to_inactive_split_view")));
+ }
+ }
+
// insert 'Properties...' entry
addSeparator();
QAction *propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
#include <QTimer>
#include <QToolButton>
+ #include <algorithm>
+
namespace
{
// Used for GeneralSettings::version() to determine whether
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);
#endif
}
+ bool DolphinMainWindow::isSplitViewEnabledInCurrentTab() const
+ {
+ return m_tabWidget->currentTabPage()->splitViewEnabled();
+ }
+
void DolphinMainWindow::openFiles(const QStringList &files, bool splitView)
{
openFiles(QUrl::fromStringList(files), splitView);
}
+ bool DolphinMainWindow::isOnCurrentDesktop() const
+ {
+ #if HAVE_X11
+ if (KWindowSystem::isPlatformX11()) {
+ const NET::Properties properties = NET::WMDesktop;
+ KWindowInfo info(this->winId(), properties);
+ return info.isOnCurrentDesktop();
+ }
+ #endif
+ return true;
+ }
+
+ bool DolphinMainWindow::isOnActivity(const QString &activityId) const
+ {
+ #if HAVE_X11 && HAVE_KACTIVITIES
+ if (KWindowSystem::isPlatformX11()) {
+ const NET::Properties properties = NET::Supported;
+ const NET::Properties2 properties2 = NET::WM2Activities;
+ KWindowInfo info(this->winId(), properties, properties2);
+ return info.activities().contains(activityId);
+ }
+ #endif
+ return true;
+ }
+
void DolphinMainWindow::activateWindow(const QString &activationToken)
{
window()->setAttribute(Qt::WA_NativeWindow, true);
});
}
+ bool DolphinMainWindow::event(QEvent *event)
+ {
+ if (event->type() == QEvent::ShortcutOverride) {
+ const QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ if (keyEvent->key() == Qt::Key_Space && m_activeViewContainer->view()->handleSpaceAsNormalKey()) {
+ event->accept();
+ return true;
+ }
+ }
+
+ return KXmlGuiWindow::event(event);
+ }
+
void DolphinMainWindow::showEvent(QShowEvent *event)
{
KXmlGuiWindow::showEvent(event);
setViewsToHomeIfMountPathOpen(mountPath);
});
- if (m_terminalPanel && m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
+ if (m_terminalPanel && m_terminalPanel->currentWorkingDirectoryIsChildOf(mountPath)) {
m_tearDownFromPlacesRequested = true;
m_terminalPanel->goHome();
// m_placesPanel->proceedWithTearDown() will be called in slotTerminalDirectoryChanged
setViewsToHomeIfMountPathOpen(mountPath);
});
- if (m_terminalPanel && m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
+ if (m_terminalPanel && m_terminalPanel->currentWorkingDirectoryIsChildOf(mountPath)) {
m_tearDownFromPlacesRequested = false;
m_terminalPanel->goHome();
}
+ cutCopyPastePara);
QAction *copyToOtherViewAction = actionCollection()->addAction(QStringLiteral("copy_to_inactive_split_view"));
- copyToOtherViewAction->setText(i18nc("@action:inmenu", "Copy to Inactive Split View"));
- m_actionTextHelper->registerTextWhenNothingIsSelected(copyToOtherViewAction, i18nc("@action:inmenu", "Copy to Inactive Split View…"));
+ copyToOtherViewAction->setText(i18nc("@action:inmenu", "Copy to Other View"));
+ m_actionTextHelper->registerTextWhenNothingIsSelected(copyToOtherViewAction, i18nc("@action:inmenu", "Copy to Other View…"));
copyToOtherViewAction->setWhatsThis(xi18nc("@info:whatsthis Copy",
"This copies the selected items from "
"the <emphasis>active</emphasis> view to the inactive split view."));
connect(copyToOtherViewAction, &QAction::triggered, this, &DolphinMainWindow::copyToInactiveSplitView);
QAction *moveToOtherViewAction = actionCollection()->addAction(QStringLiteral("move_to_inactive_split_view"));
- moveToOtherViewAction->setText(i18nc("@action:inmenu", "Move to Inactive Split View"));
- m_actionTextHelper->registerTextWhenNothingIsSelected(moveToOtherViewAction, i18nc("@action:inmenu", "Move to Inactive Split View…"));
+ moveToOtherViewAction->setText(i18nc("@action:inmenu", "Move to Other View"));
+ m_actionTextHelper->registerTextWhenNothingIsSelected(moveToOtherViewAction, i18nc("@action:inmenu", "Move to Other View…"));
moveToOtherViewAction->setWhatsThis(xi18nc("@info:whatsthis Move",
"This moves the selected items from "
"the <emphasis>active</emphasis> view to the inactive split view."));
"</para>"));
toggleSelectionModeAction->setIcon(QIcon::fromTheme(QStringLiteral("quickwizard")));
toggleSelectionModeAction->setCheckable(true);
+ actionCollection()->setDefaultShortcut(toggleSelectionModeAction, Qt::Key_Space );
connect(toggleSelectionModeAction, &QAction::triggered, this, &DolphinMainWindow::toggleSelectionMode);
// A special version of the toggleSelectionModeAction for the toolbar that also contains a menu
duplicateAction->setEnabled(capabilitiesSource.supportsWriting());
}
- if (m_tabWidget->currentTabPage()->splitViewEnabled()) {
+ if (m_tabWidget->currentTabPage()->splitViewEnabled() && !list.isEmpty()) {
DolphinTabPage *tabPage = m_tabWidget->currentTabPage();
KFileItem capabilitiesDestination;
capabilitiesDestination = tabPage->primaryViewContainer()->rootItem();
}
- copyToOtherViewAction->setEnabled(capabilitiesDestination.isWritable());
- moveToOtherViewAction->setEnabled((list.isEmpty() || capabilitiesSource.supportsMoving()) && capabilitiesDestination.isWritable());
+ const auto destUrl = capabilitiesDestination.url();
+ const bool allNotTargetOrigin = std::all_of(list.cbegin(), list.cend(), [destUrl](const KFileItem &item) {
+ return item.url().adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash) != destUrl;
+ });
+
+ copyToOtherViewAction->setEnabled(capabilitiesDestination.isWritable() && allNotTargetOrigin);
+ moveToOtherViewAction->setEnabled((list.isEmpty() || capabilitiesSource.supportsMoving()) && capabilitiesDestination.isWritable()
+ && allNotTargetOrigin);
} else {
copyToOtherViewAction->setEnabled(false);
moveToOtherViewAction->setEnabled(false);
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();
}
data.insert("type", item.mimeComment());
- } else if (m_model->sortRole() == "size" && item.isLocalFile() && !item.isSlow() && item.isDir()) {
+ } else if (m_model->sortRole() == "size" && item.isLocalFile() && item.isDir()) {
startDirectorySizeCounting(item, index);
+ return;
} else {
// Probably the sort role is a baloo role - just determine all roles.
data = rolesData(item, index);
void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &item, int index)
{
+ if (item.isSlow()) {
+ return;
+ }
+
// Tell m_directoryContentsCounter that we want to count the items
// inside the directory. The result will be received in slotDirectoryContentsCountReceived.
if (m_scanDirectories && item.isLocalFile()) {
const bool getSizeRole = m_roles.contains("size");
const bool getIsExpandableRole = m_roles.contains("isExpandable");
- if ((getSizeRole || getIsExpandableRole) && !item.isSlow() && item.isDir()) {
+ if ((getSizeRole || getIsExpandableRole) && item.isDir()) {
startDirectorySizeCounting(item, index);
}
#include "dolphin_generalsettings.h"
#include "dolphin_placespanelsettings.h"
#include "dolphinplacesmodelsingleton.h"
- #include "global.h"
#include "settings/dolphinsettingsdialog.h"
#include "views/draganddrophelper.h"
connect(this, &PlacesPanel::contextMenuAboutToShow, this, &PlacesPanel::slotContextMenuAboutToShow);
- connect(this, &PlacesPanel::iconSizeChanged, this, [this](const QSize &newSize) {
+ connect(this, &PlacesPanel::iconSizeChanged, this, [](const QSize &newSize) {
int iconSize = qMin(newSize.width(), newSize.height());
if (iconSize == 0) {
// Don't store 0 size, let's keep -1 for default/small/automatic
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>
return ContextMenuSettings::showDuplicateHere();
} else if (id == "open_terminal_here") {
return ContextMenuSettings::showOpenTerminal();
+ } else if (id == "copy_to_inactive_split_view") {
+ return ContextMenuSettings::showCopyToOtherSplitView();
+ } else if (id == "move_to_inactive_split_view") {
+ return ContextMenuSettings::showMoveToOtherSplitView();
}
return false;
}
ContextMenuSettings::setShowDuplicateHere(visible);
} else if (id == "open_terminal_here") {
ContextMenuSettings::setShowOpenTerminal(visible);
+ } else if (id == "copy_to_inactive_split_view") {
+ ContextMenuSettings::setShowCopyToOtherSplitView(visible);
+ } else if (id == "move_to_inactive_split_view") {
+ ContextMenuSettings::setShowMoveToOtherSplitView(visible);
}
}
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();