┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.h
AgeCommit message (Collapse)Author
2017-01-12Add document title to additional informationKai Uwe Broulik
Allows showing the document title of e.g. a PDF alongside the file name BUG: 321356 Differential Revision: https://phabricator.kde.org/D3972
2016-03-16Add case sensitive sorting modeArnav Dhamija
Dolphin users can now choose between 3 different sorting modes: * natural sorting * case insensitive sorting * case sensitive sorting REVIEW: 126467 BUG: 148550 FIXED-IN: 16.04.0
2016-02-09Support KFileMetadata OriginUrl as "Downloaded From"Kai Uwe Broulik
This brings back the functionality to show where a file originally was downloaded from using xattr originUrl. REVIEW: 126927
2015-02-25Move the KVersionControlPlugin2 interface from konqlib to Dolphin and remove ↵Emmanuel Pescosta
the deprecated KVersionControlPlugin interface from konqlib REVIEW: 122687
2015-02-24include KFileItem instead of KFileItemListEmmanuel Pescosta
2015-01-04Fix for crash which was introduced by commitEmmanuel Pescosta
c2a0d3e889666539669562a6c1f7a080a0f29b11 (use QCollator instead of KStringHandler) REVIEW: 121817 BUG: 342316
2014-12-17Port from KStringHandler naturalCompare to QCollator compare.Emmanuel Pescosta
Make use of the QCollator instance (m_collator) in nameRoleGroups instead of using QString::localeAwareCompare (uses QCollator internally) We don't need the m_caseSensitivity anymore, because the QCollator instance also holds this information. (This patch doesn't make use of QCollatorSortKey) Reviewed by Kai REVIEW: 121480
2014-11-20Fix Exports.Andrius da Costa Ribas
REVIEW: 121078
2014-11-03Q_DECL_OVERRIDELukáš Tinkl
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-21port Konqueror from KUrl to QUrlLukáš Tinkl
REVIEW: 120650
2014-02-11Remove some unused functions.Emmanuel Pescosta
void KFileItemModel::slotClear(const KUrl& url) bool UpdateItemsThread::lockPlugin() <- Done with QMutexLocker void UpdateItemsThread::unlockPlugin() REVIEW: 115627
2014-02-07Only initialize the hash m_items in KFileItemModel if it is neededFrank Reininghaus
Moreover, clear the entire hash if items are added or removed. This saves time and memory when loading a directory, and it fixes problems that might occur if the model is in an inconsistent state, such as crashes that can happen when we try to remove individual items from m_items. BUG: 329494 FIXED-IN: 4.13.0 REVIEW: 115432
2014-02-06Port Dolphin to BalooVishesh Handa
Nepomuk is being replaced with Baloo
2013-12-14Update the roles for filtered items if necessaryFrank Reininghaus
Since Dolphin 4.11, we store not only KFileItems, but also the corresponding ItemData struct for filtered items. This is required for keeping track of the parent-child relationships, and has the nice side effect that the ItemData need not be re-determined when the items are shown again. However, this can become a problem if the visible roles or the sort role change while some items are filtered. This is fixed by is fixed by clearing the QHash "values" for the filtered items if the visible roles change. The hash will be re-populated with all requested data as soon as the items are shown again and the data(int) method of the model is called. Moreover, before the items are inserted into the model after filtering, we have to make sure that the sort role "Permissions"/"User"/etc. is present in the hash "values". This is achieved by factoring out the code that currently does this job for new items in createItemDataList() into a new function, and calling this in insertItems(), because the same treatment is required for the previously filtered files. BUG: 328791 FIXED-IN: 4.12.1 REVIEW: 114266
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-30Sort in items in two stages to speed up natural sortingFrank Reininghaus
Sort the items in a folder first according to their name, without doing a natural/locale-aware sorting. This is very fast, but the order of the items is then already close to the final order in most cases. The number of expensive natural comparisons required to sort the items is thus greatly reduced. In my experiments with a folder with 100,000 items, the time required to sort the files was reduced by 63% with this patch. REVIEW: 113485
2013-10-07Make the code that removes items from KFileItemModel more robustFrank Reininghaus
When we remove items from the model, we called the function KFileItemModel::removeItems(const KFileItemList&, RemoveItemsBehavior). This function then looked up the indexes of the items using the hash m_items. This is wasteful in the situations when the indexes of the removed items are known in advance (like when an expanded folder is collapsed in Details View), and it can cause trouble if one item is contained in the model multiple times (can happen when searching, and a file both matches the search and is a child of a folder that matches the search). Even if expanding folders in the search results list might not be particularly useful most of the time, it makes sense to make the model more robust to prevent crashes and other unexpected behavior in such situations. This patch makes the following changes to achieve that goal: * Change the argument of removeItems() from KFileItemList to KItemRangeList. To make this work, the "look the indexes up in m_items" code is moved from that function to slotItemsDeleted(). In the other places where removeItems() is called, the indexes are calculated directly (which is not more difficult than determining the removed items as a KFileItemList, if one considers that we needed the function childItems(KFileItem) for that, which is not needed any more with this patch). * Also removeFilteredChildren() takes a KItemRangeList now. Rather than putting the parent KFileItems into a QSet for O(1) lookup (which prevents O(N^2) worst case behavior for the entire function), it uses a QSet<ItemData*> now, which should even be more efficient (hashing a pointer is cheaper than hashing a KFileItem/KUrl). BUG: 324371 BUG: 325359 FIXED-IN: 4.12.0 REVIEW: 113070
2013-10-02Save memory and time in KFileItemModel by lazy-loading the "ItemData"Frank Reininghaus
To reduce unnecessary memory comsumption and CPU usage, we only fill the QHash<QByteArray, QVariant> if the methods data(int) or setData(int) are called for the corresponding index, or the data is necessary for sorting the model. According to my tests, this patch reduces the memory usage when loading a folder with 100,000 items by 17% in Icons View, and by 26% in Details View. REVIEW: 112725
2013-09-09Merge remote-tracking branch 'origin/KDE/4.11'Frank Reininghaus
2013-09-09Always sort items correctly when the refreshItems() signal is receivedFrank Reininghaus
When sorting by, e.g., "Size", and the name is used as a fallback because there are multiple files with the same size, the refreshItems signal that is received when a file's name is changed either with the dialog or outside the current view did not cause the view to be resorted after commit d70a4811807776966c3241a72121242f4d1eaee8. This patch fixes it. BUG: 324713 FIXED-IN: 4.11.2 REVIEW: 112561
2013-09-07Make expandedParentsCount() work without accessing the data hashFrank Reininghaus
The idea is that we no longer assume that the "expandedParentsCount" for each item will be stored in the QHash. It is only accessed for items which are expanded, and which are not top-level items (i.e., which have an expandedParentsCount > 1). Some unit tests are added to improve the coverage of the affected code. REVIEW: 112562
2013-06-26Re-enable expandable folders for network top level folders (remote:/)Emmanuel Pescosta
Added a hash table for target url to url mapping. So when the dir lister sends us the target url as directory url, we can use the url mapping table to get the right "Dolphin internal" directory url, which is the non-target url. BUG: 306219 FIXED-IN: 4.11.0 REVIEW: 111252
2013-06-05Reduce KFileItemModel memory usage by making use of implicit sharingFrank Reininghaus
The idea is based on http://milianw.de/blog/katekdevelop-sprint-vienna-2012-take-1 REVIEW: 110686
2013-03-15Improve handling of filtered items when folders are deleted/collapsedFrank Reininghaus
If an expanded folder with filtered children is collapsed or removed, and the parent-child relationship cannot be determined by parsing the URLs, this patch makes sure that the filtered children do not reappear when the filter bar is cleared. REVIEW: 109455
2013-03-12Fix recent regressions when "Sort by Type" is usedFrank Reininghaus
This commit ensures that the mime types and icons are determined synchronously for 200 ms when "Sort by Type" is enabled. REVIEW: 109344
2013-02-27Removed everything related to m_expandedParentsCountRoot ->Emmanuel Pescosta
This concept is not needed anymore because of the new "determine parents and expansion levels" approach Side effect: Enables treeview for trash, ... REVIEW: 109191
2013-02-27Big Thanks to Frank Reininghaus, who helped me a lot with theseEmmanuel Pescosta
changes! :) * Fixed the "Network browser" and "timeline" issues, by using the KDirLister's itemsAdded(KUrl,KFileItemList) signal -> Use the given Url to define the parent-child relationship. * Changed the name of the slot "slotNewItems" to "slotItemsAdded" for consistency with the signal. * Use a QHash<KFileItem, ItemData*> instead of a QSet<KFileItem> to store the filtered data (needed to keep the O(1) lookup for filtered KFileItems in slotItemsDeleted + needed to fix bug 311912 "After erasing a filter, some thumbnails randomly disappear") * Made the determination of the "expandedParentsCount" slightly simpler - just adding 1 to the parent's level (Also needed to fix the "Network browser" and "timeline" issues) FIXED-IN: 4.11.0 REVIEW: 109180 BUG: 304565 BUG: 311912 BUG: 312890 BUG: 315593
2013-02-10Re-organize the code that compares expanded itemsFrank Reininghaus
The previous approach, which was based on comparing the URLs as strings, was not only very complex, but also could lead to inconsistencies in the model, namely, that not all children were removed from the model when the dir lister reported the parent as deleted. Later on, this could even lead to a crash. BUG: 311947 FIXED-IN: 4.11 REVIEW: 108766
2013-01-27Move the consistency check for KFileItemModel from the test to the classFrank Reininghaus
This makes it possible to check the model's consistency also in other places, e.g., in KFileItemModel's benchmark.
2013-01-27Add some benchmarks for KFileItemModelFrank Reininghaus
The benchmark executable must be run manually. It is not run automatically with the other unit tests to prevent waste of CPU cycles in the not-so-uncommon situation that only test failures attract attention.
2013-01-15Re-organise the sorting codeFrank Reininghaus
The KFileItemModel-specific parts are now separated from the generic ones, like the parallel sorting implementation. REVIEW: 108386
2013-01-15Change the sort and merge functions to a more generic form.Frank Reininghaus
This might make it easier to reuse the parallel sorting code. Moreover, some the upperBound/lowerBound functions have been removed because equivalents are provided by the STL.
2012-10-29Fix Bug 153984 - Clicking cancel on the authentication dialog for ↵Emmanuel Pescosta
fish/sftp/ftp kioslave gets dolphin stuck on "Loading folder" BUG: 153984 REVIEW: 107116
2012-09-07Implemented the new KParts extension, KParts::ListingiNotificationExtension.Dawit Alemayehu
REVIEW: 106333 (cherry picked from commit acef4b1c287a315b42550c27fc18ac4b9f49746c)
2012-09-05Implemented the new KParts' listing filter extension, ↵Dawit Alemayehu
KParts::ListingFilterExtension. REVIEW: 106289 (cherry picked from commit cb79ee6a881e2b4418bccc22480e3e269e5b0af9)
2012-06-13Fix regression: Open file if entering it in the URL-navigatorPeter Penz
The regression has been introduced when hiding the DolphinDirLister inside KFileItemModel. Now the signal urlIsFileError() gets forwarded to the container again where the file will be opened. BUG: 301757 FIXED-IN: 4.9.0
2012-05-26Use an italic font for symbolic linksFrank Reininghaus
BUG: 298218 FIXED-IN: 4.9.0
2012-05-17Create unit-test for KStandardItemModelPeter Penz
2012-05-17Add unit-test to test a possible crash when updating group-headersPeter Penz
2012-04-21Prepare view-engine for non-KFileItem usecasePeter Penz
Up to now the view-engine only provided a model-implementation that supports file-items. The view-engine always had been designed to be able to work with any kind of model, so now a KStandardItemModel is available. The plan is to convert the places panel to the new view-engine. It should be no problem to fix this until the feature freeze - in the worst case the places-panel code could be reverted while still keeping the KStandardItemModel changes.
2012-04-11KFileItemModel: interface cleanupsPeter Penz
Fix some naming inconsistencies regarding the usage of 'dir' vs. 'directory' vs. 'folder'.
2012-04-11KItemViews: Internal directory restructurationPeter Penz
- Move all private headers from the kitemviews-directory into the 'private' subdirectory. - Get rid of DolphinDirLister and just use a directory-lister internally in KFileItemModel. - Minor interface-cleanups for signals
2012-04-10Improvements for slow sorting rolesPeter Penz
If the sorting is done for data which is resolved asynchronously (e.g. rating), it is important to give a visual feedback about the state of the sorting. This is done now by a progress indication in the statusbar. Also optimizations for "Sort by type" have been done: Although resolving a type can be expensive in the most often case it is a very cheap operation. So it the sorting is done by type, try to resolve the type synchronously for at least 200 ms to prevent a asynchronous resorting. This is usually sufficient to have resolved types even for directories with several thousands of items. BUG: 292733 FIXED-IN: 4.9.0
2012-04-04Extract sorting-algorithm from KFileItemModel into custom classPeter Penz
2012-04-01Allow showing Nepomuk metadata inside viewsPeter Penz
Metadata like image-size, rating, comments, tags, ... can be shown now in the view (e.g. as column in the Details mode). Still open: The rating-information needs to be shown as stars. In the context of this feature also the following bugs have been fixed: - Fix visual glitches in the header of the Details mode - Improve the minimum column width calculation to respect also the headling and not only the content BUG: 296782 FIXED-IN: 4.9.0
2012-03-20KFileItemModel: Remove minimum-update timerPeter Penz
The timer became unnecessary after introducing the behavior to collect all new items until KDirLister emits a completed()-signal.
2012-03-14Use sub-menus for the "Sort By"- and "Additional Information"-menuPeter Penz
This allows doing some grouping for the visible roles by e.g. Image, Document, Music or whatever.
2012-03-13Remove RolesInfoAccessorPeter Penz
Now KFileItemModel provides a way to access the available roles including their translations. Note that the 3 roles "comments", "rating" and "tags" have not been implemented yet in KFileItemModel and turning them on does not work currently.
2012-02-23Whitespace cleanups and documentation fixesPeter Penz