┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontroller.cpp
AgeCommit message (Collapse)Author
2018-03-10Fix some compile warningsRoman Inflianskas
Reviewers: markg, elvisangelaccio Reviewed By: markg, elvisangelaccio Subscribers: chehrlic, rkflx, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10995
2018-03-05Revert "Fix some compile warnings"Elvis Angelaccio
This reverts commit 533f050855a50212bba7be57a1590f9ce743e26d. D10995 has not been approved.
2018-03-04Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: bcooksley, markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-03-04Fix some compile warningsRoman Inflianskas
Reviewers: #dolphin, markg Reviewed By: markg Subscribers: elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10995
2018-03-03Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-02-05Faster drag&drop in directories with thousands of filesJaime Torres
Summary: The check is called when the mouse is moved in a drag&drop operation. Dragging all files in a directory with 3000 files under callgrind, moving the mouse to the other panel and then canceling, doing it twice, callgrind shows that the method urlListMatchesUrl is called around 200 times, spending around 9,30% of the cpu in those calls. Applying the patch, callgrind tells it uses now 0.31% of the cpu in 1208 calls. CCBUG: 342056 Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, anthonyfieroni, michaelh, elvisangelaccio, ngraham Differential Revision: https://phabricator.kde.org/D10085
2017-12-14Implemented support for hide/show groupsRenato Araujo Oliveira Filho
Summary: Added an option on PlacesPanel context menu to show or hide the entire group of places. Depends on D8855 Test Plan: Open Donlphin and use PlacesPanel context menu to hide and show groups Reviewers: franckarrecot, mlaurent, mwolff, elvisangelaccio Reviewed By: franckarrecot, mlaurent, mwolff, elvisangelaccio Subscribers: rkflx, mwolff, elvisangelaccio, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D9242
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-11Prevent folders from drag and dropping onto themselves in dolphin main viewEmirald Mateli
Summary: This patch aims to improve user experience by not allowing the user to drag and drop a folder into itself. The current behavior shows a red message at the top which can then be closed by the user, instead of relying on that, this patch disables the option of dropping onto self and uses the "Invalid drop target cursor" to highlight the behavior. BUG: 307747 Since spectacle is unable to screenshot the cursor overlay, find attached a photo of the screen. {F3787651} Test Plan: 1. Drag a folder. 2. Drop it onto itself. Reviewers: #dolphin, elvisangelaccio, ngraham, rkflx, dfaure Reviewed By: #dolphin, elvisangelaccio, rkflx, dfaure Subscribers: rkflx, ngraham, elvisangelaccio, dfaure, anthonyfieroni, #konqueror Tags: #dolphin Differential Revision: https://phabricator.kde.org/D6281
2017-10-27Two clicks on file/folder to renameAndreas Krutzler
Summary: Make renaming of files/folders faster by clicking a second time on the items text to start renaming. BUG: 205157 Test Plan: This feature works as follows: 1. select an item by single-click, or one is already selected 2. wait the "double-click-interval" 3. click on the items text 4. none of the cancellations (see below) happens within the double-click-interval 5. inline-renaming starts Cancellations: * open any file/folder * select different item(s) * start dragging items * Dolphin loses focus This feature is just enabled while "Double-click to open files and folders" in system-settings and "Rename inline" in Dolphin are enabled. Reviewers: #dolphin, #kde_applications, elvisangelaccio, emmanuelp, ngraham, markg, rkflx Reviewed By: #dolphin, #kde_applications, elvisangelaccio, ngraham, rkflx Subscribers: rkflx, markg, funkybomber, sars, elvisangelaccio, ngraham Differential Revision: https://phabricator.kde.org/D7647
2017-06-11Ignore drops-onto-items from invalid places itemsElvis Angelaccio
If the QMimeData object created by PlacesItemModel doesn't have any url set (e.g. when dragging unmounted devices), it is detected by the resulting DropJob as "drop raw data" because the mimeData has one format set (the internalMimeType() used for dragging between places items). This results in a crash because the DropJob schedules a PasteJob, but in the meantime the QDrag from Dolphin ends and deletes the mimeData object that was passed to the paste job. The fix is to prevent the DropJob in the first place. We can introduce a new internal mimetype that we use to blacklist drops-onto-items (while still allowing drops-between-items). This way PlacesItemModel can set the blacklist flag if the mimeData is being created without urls. BUG: 373005 FIXED-IN: 17.04.3 Test Plan: Drag and drop an unmounted device to another place item or the DolphinView, doesn't crash anymore. Dropping the unmounted device between two places item still works. Differential Revision: https://phabricator.kde.org/D5535
2017-02-20Work round missing right click event after dismissing a context menuDavid Edmundson
There is a bug that can happen in the following situation: - user right clicks to open a menu - that context menu grabs input - the QGrabphicsView also notes the mouse was pressed, but not that the mouse was released because it doesn't have mouse events any more - when a user clicks to dismiss the menu and then without moving clicks quickly again to send, we don't get another press event because the QGraphicsScene still thinks the mouse is pressed from the first time the context menu was shown and QGraphicsScenePrivate::lastMouseGrabberItemHasImplicitMouseGrab still points to the old object. This is a known bug in QGraphicsView and you can see QGraphicsScenePrivate::sendMouseEvent has a workaround to reset the lastMouseGrabberItemHasImplicitMouseGrab on mouse moves, with the comment: "This is a temporary fix for until we get proper mouse grab events." Realistically this isn't going to happen in QGraphicsView now. We do get a double click event though. By checking for double click events we can grab those missed clicks. It doesn't cause any other side effects because normally the context menu will fire after the first click and this rarely gets processed. REVIEW: 129960
2015-03-25Create drag pixmaps which match the device pixel ratioDavid Edmundson
2015-02-26Port away from KDELibs4Support (we only use KDELibs4Support when baloo isn't ↵Emmanuel Pescosta
present, because KFileMetaDataWidget is in KDELibs4Support) Reviewed-By: Vishesh Handa
2015-02-06Fix includesMontel Laurent
2015-02-01Port away from KGlobalSettings::singleClick() and use the mouse kcm module ↵Emmanuel Pescosta
instead of implementing the single/double click settings on our one. REVIEW: 122311
2014-10-27Port to QDebug*. KVBox--Montel Laurent
2014-09-11fixed TODO:Emmanuel Pescosta
Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton
2014-06-29Remove the automoc noiseChristophe Giboudeaux
2014-05-13Merge remote-tracking branch 'origin/master' into frameworksFrank Reininghaus
Since the master branch had never been merged into frameworks since the creation of the frameworks branch, I had to fix a couple of merge conflicts and make another change in order to make it build - I hope I did not get anything wrong. We should probably merge master into frameworks on a regular basis from now on. CCMAIL:[email protected] Conflicts: dolphin/src/dolphinmainwindow.cpp dolphin/src/search/dolphinfacetswidget.cpp dolphin/src/statusbar/dolphinstatusbar.cpp dolphin/src/views/dolphinview.cpp
2014-05-05dolphin: convert kitemviews/ to qt5 signal slot syntaxAlex Richardson
This conversion was performed automatically using convert2qt5signalslot. The only manual changes required were changing the overloaded signal KDirLister::redirection and KDirLister::completed from KUrl to QUrl. All other cases were no problem since these signals are not overloaded and a static_cast for disambiguation is not necessary. Code inside HAVE_BALOO is not converted yet, will do that once I can build a version with Baloo.
2014-03-03Add a hover effect for the selection toggle.Emmanuel Pescosta
FIXED-IN: 4.13.0 REVIEW: 116028 BUG: 299328
2014-03-01Always go back/forward in history when pressing the respective buttonsFrank Reininghaus
Before this patch, pressing one of these buttons while an item is hovered selected this item. The motivation for this behavior was to provide a fast way to select items. However, this was counter-intuitive and confusing for many users. BUG: 310288 FIXED-IN: 4.13.0 REVIEW: 116469
2013-11-14Merge remote-tracking branch 'origin/KDE/4.11' into KDE/4.12Frank Reininghaus
2013-11-14Do not select items when navigating back/forward with the mouseDavid Rosca
If we detect that the user pressed the back/forward buttons while hovering the empty space of the view, such that DolphinView::slotMouseButtonPressed(int, Qt::MouseButtons) will request that Dolphin navigates back/forward in the history, handling the mouse press event should stop. This prevents the possible unexpected selection of items in the new directory. BUG: 327412 FIXED-IN: 4.11.4
2013-10-30Store the selected items in a more efficient wayFrank Reininghaus
Since Dolphin 2.0, we have stored the selected items in a QSet<int>, which is neither space-efficient nor particularly fast when inserting many items which are in a consecutive range. This commit replaces the QSet<int> by a new class "KItemSet", which stores the items in a sorted list of ranges. For each range, we only store the first index and the length of the range, so we need a lot less memory for most common selection patterns, and we also save quite a few CPU cycles in many situations, because adding an item to the KItemSet will in many cases not need a memory allocation at all, and it's particularly easy when inserting sorted items into the KItemSet in a row. KItemSet contains a minimal subset of QSet's API which makes it suitable as a drop-in replacement for our needs. It also has iterators, such that the items can be iterated through easily, also with foreach. One advantage of KItemSet compared to QSet<int> is that the items are always iterated through in ascending order. REVIEW: 113488
2013-10-16Abort loading the current URL if the user presses EscapeFrank Reininghaus
BUG: 323181 FIXED-IN: 4.12.0 REVIEW: 113234
2013-10-07Include "Space" in the keyboard search stringFrank Reininghaus
Before this commit, we only added pressed keys to the search string if they have no other meaning. This means that files containing a Space in their name could not be searched because Ctrl+Space toggles the selection state of the current item, and Space alone selects the current item. After this commit, Space is added to the search string if (a) the key press did not have any other effect, i.e., if Ctrl was not pressed, and the current item is selected already, and (b) a keyboard search has been started already (to prevent unexpected effects when pressing Space accidentally - I think that it's rather uncommon to have files whose names start with a Space - and to make the unit test simpler). I modified the unit test of KItemListController, which did not test keyboard search yet. This uncovered a small problem in KItemListController::slotChangeCurrentItem() when NoSelection mode is used. It's not really relevant for anything that is executed inside Dolphin, but I still fixed it to make the unit test happy. BUG: 324479 FIXED-IN: 4.11.3 REVIEW: 113071
2013-06-20Hide the "drop" indicator when an item is not hovered any moreFrank Reininghaus
This fixes the problem that the drop indicator might still be shown after the drag&drop operation in the Places Panel is finished. REVIEW: 111037
2013-05-13Dolphin Places: Make it easier to drag and drop itemsVishesh Handa
When doing a drop, a check is performed to see if it is within x pixels from the top or x pixel from the bottom of the rect. If it is, then the drop is considered a drop between items. This x was fixed to qMax( 4, myStyleOption.padding ) which would generally be 4. This is fine for some cases, but when the rectangle size increases then this 4 pixels is not enough. Hence this 'x' is now being set to 30% of the rectangle height. By default the rectangle height is 20 pixels, so x is now 6 instead of 4 in the default case, which does make it slightly easier. Also, this in-between-items check is only performed when moving from one item to another. This is not good since if you enter the item and the bottom, the indicator is shown, and then as to start moving it up it stops showing, and then it should start showing again as you approach the top edge. Modified the code to run the check on every mouse drag event even if the hovered item has not changed. Both these changes combined make it much easier to drag and drop items. REVIEW: 110342
2013-02-05Apply changes of the KGlobalSettings::singleClick() setting immediatelyAniket Anvit
Fixes a regression introduced by commit 7a364cbf489af25e123d18713523151a3a53f814. Patch reviewed and pushed by Frank Reininghaus. BUG: 313342 FIXED-IN: 4.10.1
2012-10-03Merge branch '4.9'Dawit Alemayehu
2012-09-28Redo the fix for CTRL+Tab not working when using Dolphin's filemanagement partDawit Alemayehu
in Konqueror. The original fix, commit 4f7ed2b, prevents drag and drop from working correctly. CCBUG: 302329 REVIEW: 106569
2012-09-25Fixes Bug 305783 - dragging a file over a directory #c4Emmanuel Pescosta
does not expand the dir => Bug discovered: When you drag a item onto a folder-view-item and then move it away instantly before the autoactivation event is triggered (After 750ms), the folder will be opened anyway. BUG: 305783 REVIEW: 106381 FIXED-IN: 4.9.2 (cherry picked from commit 9ab8bcd6aa3ce5d96ee380d5f22d77c2f0a38881)
2012-09-22Merge branch for accessibilityAmandeep Singh
2012-09-21Merge branch 'KDE/4.9'Luca Beltrame
Conflicts: konq-plugins/dirfilter/dirfilterplugin.cpp konq-plugins/dirfilter/dirfilterplugin.h
2012-09-20Restore old behavior: Navigating by double-clicking in folder panel ↵Emmanuel Pescosta
(Double-Click - show folder content and expand folder) BUG: 295573 REVIEW: 106497 FIXED-IN: 4.9.2
2012-09-19Fixes Bug 293200 - Drag&drop files in dolphin doesnt preserve originEmmanuel Pescosta
Patch 106381 Comment #3: When "Open folders during drag operations" is enabled, two things happen, both in the DolphinView and in the Folders Panel: 1) When hovering a folder that can be expanded (this is the case for folders with sub-folders in the Folders Panel and in the DolphinView if in Details View mode), toggle its "expanded" state. 2) When hovering a folder that can not be expanded (i.e., a folder without sub-folders or any folder in Icons or Compact View), open this folder in the DolphinView via the KItemListController's itemActivated(int) signal. The bug described in bug 293200 comment 3 is that 1) is always wanted, but 2) is not wanted for the Folders Panel. BUG: 293200 FIXED-IN: 4.9.2
2012-09-12Fixes Bug 305783 - dragging a file over a directory #c4Emmanuel Pescosta
does not expand the dir => Bug discovered: When you drag a item onto a folder-view-item and then move it away instantly before the autoactivation event is triggered (After 750ms), the folder will be opened anyway. BUG: 305783 REVIEW: 106381
2012-08-14Minor fixes to accessible interfacesAmandeep Singh
2012-08-14Focus-tracking for widgets in Dolphin View now works.Amandeep Singh
Added the calls to updateAccessibility, for DragDrop & Focus scenarios
2012-07-12Re-implement dropping of files on folders in the Places Panel.Frank Reininghaus
This resolves a regression caused by the Places Panel rewrite. There is a small glitch left when reordering items (dragging below the last or above the first item only shows the drop indicator when first dragging out of the item and then back), but I prefer not to fix this glitch right now because this would require a more intrusive change, and I do not want to risk regressions because is not much time left to fix them before 4.9.0 is released. Thanks to Peter Penz for providing some advice about this issue. BUG: 302557 FIXED-IN: 4.9.0 (cherry picked from commit f4c960025167b7c7e04e1290ac9d9fee03a9b62d)
2012-07-12Re-implement dropping of files on folders in the Places Panel.Frank Reininghaus
This resolves a regression caused by the Places Panel rewrite. There is a small glitch left when reordering items (dragging below the last or above the first item only shows the drop indicator when first dragging out of the item and then back), but I prefer not to fix this glitch right now because this would require a more intrusive change, and I do not want to risk regressions because is not much time left to fix them before 4.9.0 is released. Thanks to Peter Penz for providing some advice about this issue. CCBUG: 302557
2012-06-12Drag-pixmap fixesPeter Penz
- Don't use the selection-tinted icon when dragging a single item - Decrease the vertical gap for the hotspot - Prevent drawing tree-lines when dragging items for the Places Panel CCBUG: 301624
2012-06-03Ctrl+Shift+click should have the same effect as Shift+clickFrank Reininghaus
This makes Dolphin 2.0's behaviour consistent with Dolphin 1.x. BUG: 300788 FIXED-IN: 4.9.0
2012-05-30Improve arrow key navigation in Details View with expanded foldersFrank Reininghaus
If the current folder is collapsed, pressing the left arrow key now moves the focus to the parent folder. CCBUG: 300582 (cherry picked from commit 93daadae28f7e3b5cffd7b713a2a287e4fa62ccd)
2012-05-26Further preperations for drag & drop support in the places panelPeter Penz
2012-05-21Places Panel: Show drop indicatorPeter Penz
The dropping itself has not been implemented yet.
2012-05-18Enable basic drag and drop support for the Places PanelPeter Penz
The dropping has not been implemented yet, however in the context of this step the creating of the drag-pixmap is now forwarded to the item-widgets. This allows creating some optimized dragging-pixmaps e.g. for the details-view, where only the name and icon should be provided as drag-pixmap.
2012-04-30Fix crash when closing Dolphin during generating previewsPeter Penz
BUG: 299108 FIXED-IN: 4.9.0