┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemmodelbase.cpp
AgeCommit message (Collapse)Author
2026-01-22clang-tidy: use default for trivial constructorMéven Car
2024-03-08Start autoActivationTimer only if hovering over a directoryAkseli Lahtinen
Before starting autoActivationTimer, check that we're hovering the item on top of a directory. If we don't check for it, the the autoActivationTimer will try to open the hovered item in it's default application, which can be distracting and break the actual action the user was trying to do, like moving the file to a directory. BUG:479960
2023-12-25Fix issues if QT_NO_CAST_FROM_ASCII is definedMarius P
Fix issues e.g. "error: ‘QString::QString(const QByteArray&)’ is private within this context".
2023-07-05Add explicit moc includes to sources for moc-covered headersFriedrich W. H. Kossebau
* speeds up incremental builds as changes to a header will not always need the full mocs_compilation.cpp for all the target's headers rebuild, while having a moc file sourced into a source file only adds minor extra costs, due to small own code and the used headers usually already covered by the source file, being for the same class/struct * seems to not slow down clean builds, due to empty mocs_compilation.cpp resulting in those quickly processed, while the minor extra cost of the sourced moc files does not outweigh that in summary. Measured times actually improved by some percent points. (ideally CMake would just skip empty mocs_compilation.cpp & its object file one day) * enables compiler to see all methods of a class in same compilation unit to do some sanity checks * potentially more inlining in general, due to more in the compilation unit * allows to keep using more forward declarations in the header, as with the moc code being sourced into the cpp file there definitions can be ensured and often are already for the needs of the normal class methods
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2020-10-23Compile with QT_NO_KEYWORDSAlexander Lohnau
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2019-11-16Use URLs with transport encryptionYuri Chornoivan
2019-11-09Remove unnecessary semicolons after Q_UNUSEDElvis Angelaccio
GIT_SILENT
2018-12-01Do not sort twice when changing role and order at the same timeThomas Surrel
Summary: When using the list header to change the role and order, if one changes the order to descending and then changes role, dolphin also changes the order back to ascending. This results in sorting the list of files twice in a row. This patch removes the first (useless) sort. Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17111
2018-02-03Add newline at the end of kitemmodelbase.cppElvis Angelaccio
As recommended by krazy. GIT_SILENT
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-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
2014-06-29Remove the automoc noiseChristophe Giboudeaux
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-09-17Move KItemRange to its own headerFrank Reininghaus
Also factor out the code that transforms a sorted list of ints to a KItemRangeList. This removes some duplicated code from KFileItemModel. Note that overriding operator<<() in KItemRangeList was necessary because it's not a typedef for QList<KItemRange>, but a class derived from that now, and some code fails to compile if the return type of that function is QList<KItemRange> and not KItemRangeList. REVIEW: 112728
2012-02-14Details view: Fix indicator-branchesPeter Penz
Up to now no indicator-branches have been drawn when showing a tree. The patch fixes this so that that the style-dependent branches are drawn. The main part of the patch is the implementation of KItemListView::updateSiblingsInformation(). Most of the other changes are related due to an internal renaming of the expansionsLevel-role to expandedParentsCount and some related cleanups. BUG: 290276 FIXED-IN: 4.8.1
2011-11-26Folders Panel fixesPeter Penz
The following functionality from Dolphin 1.x has been ported to the new view-engine: - Allow expanding/collapsing of items - Automatically select the current item - Context menu for items Related improvements to the view-engine: - Make the expanding/collapsing interface already accessible in the base classes KItemModelBase and KItemListView. If no expanding/collapsing is supported at all by derived models (which is usually the default case) simply not reimplementing those 3 methods is sufficient and it does not introduce an additional complexity like in QAbstractItemModel/QModelIndex. - Automatically handle the expanding/collapsing in KItemListController. This also includes the key-handling, which is quite special for expandable items. - Don't let KItemListView automatically scroll to the current item if the current item got changed. The automatic scrolling should only be done if the current item has been changed by the user. Hence this functionality has been moved to the KItemListController which currently only triggers the automatic scrolling if the current item has been changed by the keyboard (we might extend the usecases later if required).
2011-10-15Interface cleanups to prepare the return of "grouped sorting"Peter Penz
- Rename setCategorizedSorting() to setGroupedSorting() - Change the model interface to allow enabling/disabling grouping without the need to declare a role (the sort role will be taken). - Add dummy group role implementation in KFileItemModel The grouping code itself requires some cleanups and might crash at the moment or lead to weird layouts.
2011-09-18Implement some missing sorting optionsFrank Reininghaus
Changing the sort order and enabling/disabling the "Sort Folders First" option works now.
2011-09-04Improved drag and drop supportPeter Penz
2011-08-29Removed a warning of unused variableTirtha Chatterjee
2011-08-29Added support for highlighting items by typing their name on the keyboard.Tirtha Chatterjee
2011-08-24Interface cleanups for drag and drop supportPeter Penz
2011-08-15Add unit test for expanding folders in KFileItemModelFrank Reininghaus
2011-07-30Merged very early alpha-version of Dolphin 2.0Peter Penz
Dolphin 2.0 will get a new view-engine with the following improvements: - Better performance - Animated transitions - No clipped filenames due to dynamic item-sizes - Grouping support for all view-modes - Non-rectangular selection areas - Simplified code for better maintenance More details will be provided in a blog-entry during the next days. Please note that the code is in a very early alpha-stage and although the most tricky parts have been implemented already very basic things like drag and drop or selections have not been pushed yet. Those things are rather trivial to implement but this still will take some time.