Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:epopov:branches:openSUSE:Factory
dolphin
2000-selection-mode.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2000-selection-mode.patch of Package dolphin
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index ee6cfea52aa086600c0d88afde8ef79b684238c3..0d9d244ae3baf4131ff30d6bc000de19d2f21007 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -747,9 +747,7 @@ void DolphinMainWindow::undo() void DolphinMainWindow::cut() { - if (m_activeViewContainer->view()->selectedItems().isEmpty()) { - m_activeViewContainer->setSelectionModeEnabled(true, actionCollection(), SelectionMode::BottomBar::Contents::CutContents); - } else { + if (m_activeViewContainer->view()->selectedItemsCount() > 0) { m_activeViewContainer->view()->cutSelectedItemsToClipboard(); m_activeViewContainer->setSelectionModeEnabled(false); } @@ -757,9 +755,7 @@ void DolphinMainWindow::cut() void DolphinMainWindow::copy() { - if (m_activeViewContainer->view()->selectedItems().isEmpty()) { - m_activeViewContainer->setSelectionModeEnabled(true, actionCollection(), SelectionMode::BottomBar::Contents::CopyContents); - } else { + if (m_activeViewContainer->view()->selectedItemsCount() > 0) { m_activeViewContainer->view()->copySelectedItemsToClipboard(); m_activeViewContainer->setSelectionModeEnabled(false); } @@ -1723,7 +1719,6 @@ void DolphinMainWindow::setupActions() "</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 @@ -2288,19 +2283,10 @@ void DolphinMainWindow::updateFileAndEditActions() QAction *copyLocation = col->action(QString("copy_location")); if (list.isEmpty()) { + m_actionTextHelper->textsWhenNothingIsSelectedEnabled(true); stateChanged(QStringLiteral("has_no_selection")); - // All actions that need a selection to function can be enabled because they should trigger selection mode. - renameAction->setEnabled(true); - moveToTrashAction->setEnabled(true); - deleteAction->setEnabled(true); - cutAction->setEnabled(true); - duplicateAction->setEnabled(true); addToPlacesAction->setEnabled(true); - copyLocation->setEnabled(true); - // Them triggering selection mode and not directly acting on selected items is signified by adding "…" to their text. - m_actionTextHelper->textsWhenNothingIsSelectedEnabled(true); - } else { m_actionTextHelper->textsWhenNothingIsSelectedEnabled(false); stateChanged(QStringLiteral("has_selection")); @@ -2322,7 +2308,7 @@ void DolphinMainWindow::updateFileAndEditActions() deleteWithTrashShortcut->setEnabled(capabilitiesSource.supportsDeleting() && !enableMoveToTrash); cutAction->setEnabled(capabilitiesSource.supportsMoving()); copyLocation->setEnabled(list.length() == 1); - showTarget->setEnabled(list.length() == 1 && list.at(0).isLink()); + showTarget->setEnabled(list.length() == 1 && list.first().isLink()); duplicateAction->setEnabled(capabilitiesSource.supportsWriting()); } diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 60f23c1dbe6b6ee1e2a1d21cec7173700db47bc3..6a4449035fdc2392f06fcb2d0b0513b4b66ac52c 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -448,6 +448,7 @@ bool KItemListController::keyPressEvent(QKeyEvent *event) const int current = m_selectionManager->currentItem(); if (!m_selectionManager->isSelected(current)) { m_selectionManager->setSelected(current); + m_selectionManager->beginAnchoredSelection(current); break; } } diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index ae01437bacdc026ae78c81acf216eb401fd1a1d6..7b5c87ed10f6f58980cdf3c1c850e9405cd00503 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -419,20 +419,15 @@ void DolphinViewActionHandler::slotViewModeActionTriggered(QAction *action) void DolphinViewActionHandler::slotRename() { - if (m_currentView->selectedItemsCount() == 0) { - Q_EMIT selectionModeChangeTriggered(true, SelectionMode::BottomBar::Contents::RenameContents); - } else { + if (m_currentView->selectedItemsCount() > 0) { Q_EMIT actionBeingHandled(); m_currentView->renameSelectedItems(); - // We don't exit selectionMode here because users might want to rename more items. } } void DolphinViewActionHandler::slotTrashActivated() { - if (m_currentView->selectedItemsCount() == 0) { - Q_EMIT selectionModeChangeTriggered(true, SelectionMode::BottomBar::Contents::MoveToTrashContents); - } else { + if (m_currentView->selectedItemsCount() > 0) { Q_EMIT actionBeingHandled(); m_currentView->trashSelectedItems(); Q_EMIT selectionModeChangeTriggered(false); @@ -441,9 +436,7 @@ void DolphinViewActionHandler::slotTrashActivated() void DolphinViewActionHandler::slotDeleteItems() { - if (m_currentView->selectedItemsCount() == 0) { - Q_EMIT selectionModeChangeTriggered(true, SelectionMode::BottomBar::Contents::DeleteContents); - } else { + if (m_currentView->selectedItemsCount() > 0) { Q_EMIT actionBeingHandled(); m_currentView->deleteSelectedItems(); Q_EMIT selectionModeChangeTriggered(false); @@ -744,9 +737,7 @@ void DolphinViewActionHandler::slotAdjustViewProperties() void DolphinViewActionHandler::slotDuplicate() { - if (m_currentView->selectedItemsCount() == 0) { - Q_EMIT selectionModeChangeTriggered(true, SelectionMode::BottomBar::Contents::DuplicateContents); - } else { + if (m_currentView->selectedItemsCount() > 0) { Q_EMIT actionBeingHandled(); m_currentView->duplicateSelectedItems(); Q_EMIT selectionModeChangeTriggered(false); @@ -772,9 +763,7 @@ void DolphinViewActionHandler::slotProperties() void DolphinViewActionHandler::slotCopyPath() { - if (m_currentView->selectedItemsCount() == 0) { - Q_EMIT selectionModeChangeTriggered(true, SelectionMode::BottomBar::Contents::CopyLocationContents); - } else { + if (m_currentView->selectedItemsCount() > 0) { m_currentView->copyPathToClipboard(); Q_EMIT selectionModeChangeTriggered(false); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor