┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodelrolesupdater.h
AgeCommit message (Collapse)Author
2026-02-07Remove preview ignore maximum local size handling from DolphinKai Uwe Broulik
This all seems to be done by the PreviewJob in KIO already.
2026-02-04KFileItemModelRolesUpdater: Use mime type from preview job, if anyKai Uwe Broulik
The preview job does an async stat on the file, so we might as well use its information to determine the icon. Also only determine mime type in the final "ResolveAll" step since it will initially resolve roles but mime type isn't necessarily fast.
2026-01-22clang-tidy: avoid copy, use const referencesMéven Car
2025-03-13KFileItemModelRolesUpdater: reset size and count before updating foldersAkseli Lahtinen
Folder count would not update properly when user would delete file from a folder, or add a new file to it. Previously when size value is set to -2 after update, the update will never be called again unless user presses F5. This change will instead reset that -2 to 0 whenever we are requesting for calculating directory sizes. We never updated the count when a file was deleted, so that has been added as well. This change also calculates the item counts from the processedAmount, which is the total amount of items we're processing. From there we remove the unwanted items and get the final count. For remote files, we set the count to -1 since we don't calculate them. BUG: 500502
2025-01-17Refactor Overlay HandlingMéven Car
Now all overlays icons in kitemviews are added in KStandardItemListWidget::updatePixmapCache. data[iconOverlays] now contains icon names. DolphinFileItemListWidget::refreshCache is the sole responsible of setting the overlays either coming from KFileItemModelRolesUpdater or KVersionControlPlugin. This garantees consistency in rendering. BUG: 497372
2025-01-11KFileItemModelRolesUpdater: add utility cacheSize functionMéven Car
2025-01-11KFileItemModelRolesUpdater: Show emblems even in hover sequenceMéven Car
2024-12-19dolphinview: Update thumbnail on filename changeAkseli Lahtinen
If filename of an item was updated previously, it would modify the model before the file was actually changed. This led to the model calling a signal that would try to run a previewjob, but since the filename is not actually changed yet on disk, it would fail. This patch moves the model updating after copyjob. Copyjob will take care of the file renaming if there is already existing file. We just need to update the model correctly after the job has succeeded. BUG:497555
2023-11-21Create thumbnails with scene devicePixelRatioKai Uwe Broulik
2023-05-26KDirectoryContentsCounter: show intermediate dir size counting results, ↵Méven Car
improve stopping, improve data caching Two user visible changes: * we can see the dir size changing as it is updated. * This makes the file counting a lot more reactive, when changing directories for instance. `KDirectoryContentsCounterWorker::walkDir` is not recursive anymore. The cache is now shared and only a single thread is used to count size recursively.
2023-02-12Optimize Directory size countingMéven Car
Two changes: * Prioritise size counting for visible path * stop the worker when switching dirs
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2022-10-11don't use const'ref here (found by clazy)Laurent Montel
2022-07-18Remove references to KServiceTypeTrader in commentsNicolas Fella
2022-06-15Cleanup config-dolphin.h includesAhmad Samir
2022-06-15Use cmakedefine01Ahmad Samir
This way we get a build time warning if the var isn't defined at all, e.g. a missing check_include_files() CMake call.
2022-06-15Use one config-dolphin.h.cmake configuration fileAhmad Samir
2021-07-04Add support for hover sequence thumbnails (via ThumbSequenceCreator)David Lerch
This shows a slideshow of thumbs when the user hovers a file item.
2021-02-09Build with QT_NO_KEYWORDSNicolas Fella
2020-11-03FolderPanel: prevents scanning directory tree recursivelyMéven Car
KFileItemListView contents are periodically scanned by KFileItemModelRolesUpdater. It uses then KDirectoryContentsCounter to scan directories to determine their size possibly recursively. Introduce a scanDirectories setting to disable directory scanning by KFileItemModelRolesUpdater. BUG: 426617 FIXED-IN: 20.08.3
2020-10-17Remove not implmemented methodLaurent Montel
2020-09-13Fix wreorder warningAyushmaan jangid
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.
2020-06-09Provide ability to configure size cut-off for local file previewsGastón Haro
Summary: FileWidgets read from kdeglobals the property "MaximumSize" under "PreviewSettings" to decide if a preview will be generated for that file. There is no current GUI to change that file size limit. On the other hand Dolphin ignores it. This patch aims to fix that by adding new configuration options to Dolphin. That is a new spinbox in Dolphin settings under General -> Previews tab. Test Plan: 1 - Set up a local folder with 2 jpg images of less and more than 1 MB respectively. 2 - Go to Dolphin Preferences. General -> Previews and check "JPEG Images" from the list. And set "Skip previews for files above:" to 1MB. 3 - Navigate to the afore mentioned folder. Only the image of size less than 1 MB should show a preview. BUG: 331240 Reviewers: ngraham, #dolphin, meven, elvisangelaccio Reviewed By: ngraham, #dolphin, meven, elvisangelaccio Subscribers: cfeck, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28402
2020-05-04[Details mode] Allow to fill the column size of directories with actual sizeMéven Car
Summary: Allow to compute the recursive size of directories to fill the details view size column. A setting allow to set a limit to the recursive level, allowing the user to have some power over the setting. When sorting by size and the feature is on, we get progressive ordering as the directory size are gathered. KDirectoryContentsCounter uses a cache internally to keep results so that it can display directory size faster, but counts the dir size of directories each time it is asked to count the size a directory nevertheless and when the size has changed, it is updated. KDirectoryContentsCounter uses one worker per instance only, meaning one process per view makes the disk spin. FIXED-IN: 20.08 BUG: 190580 BUG: 158090 Test Plan: With some recursion allowed: {F8267580} Without any recursion allowed (default): {F8267581} Reviewers: elvisangelaccio, ngraham, #dolphin Reviewed By: elvisangelaccio, ngraham, #dolphin Subscribers: feverfew, anthonyfieroni, iasensio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25335
2019-01-11Consti'fyLaurent Montel
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
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-20Modernize: Use override where possibleKevin Funk
Also use override instead of Q_DECL_OVERRIDE
2015-11-28Fix wrong path->URL conversion.David Faure
2015-11-04Use the new KOverlayIconPlugin interface from KIO::WidgetsOlivier Goffart
REVIEW: 125675
2015-10-10Only perform operations with Baloo if it is enabledVishesh Handa
REVIEW: 125584
2015-02-25Move the KVersionControlPlugin2 interface from konqlib to Dolphin and remove ↵Emmanuel Pescosta
the deprecated KVersionControlPlugin interface from konqlib REVIEW: 122687
2014-11-20Fix Exports.Andrius da Costa Ribas
REVIEW: 121078
2014-10-18fix forward declarationMontel Laurent
2014-10-14Port Dolphin to the new Baloo APIsVishesh Handa
REVIEW: 120582
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-02-06Port Dolphin to BalooVishesh Handa
Nepomuk is being replaced with Baloo
2014-01-06Avoid calling KFileItemModel::index() in KFileItemModelRolesUpdaterFrank Reininghaus
KFileItemModel allows to find out the index of a KFileItem with its index(const KFileItem&) method. Calling this method is not extremely expensive, but it's also not free (it looks up the URL of the KFileItem in a QHash, i.e., it has to call qHash(QString) for the full URL). In KFileItemModelRolesUpdater, we sometimes converted the known index to a KFileItem and then back to an index in applyResolvedRoles(KFileItem). This patch fixes this by modifying applyResolvedRoles such that it takes the index directly as its argument. REVIEW: 114847
2013-09-04Count the items inside directories in another threadFrank Reininghaus
This prevents that the GUI freezes if there are many files inside the directory, or if the access to the directory is slow for some other reason. BUG: 318518 REVIEW: 111920 FIXED-IN: 4.12.0
2013-07-18Fix build if HAVE_NEPOMUK is not definedFrank Reininghaus
We really have to make nepomuk-core and nepomuk-widgets a hard dependency in the framworks era.
2013-07-18Overwrite the changed role value with an empty QVariant,Emmanuel Pescosta
because the nepomuk roles provider doesn't overwrite it when the property value list is empty. BUG: 322348 REVIEW: 111505 FIXED-IN: 4.11.0
2013-07-12Load unknown icons for items just before showing items in the viewFrank Reininghaus
Rather than loading many icons (without full mime type determination) in advance, we make sure that an item has an icon just before it is shown in the view. This makes sure that no "unknown" icons are shown unnecessarily, and saves some resources. REVIEW: 111396
2013-06-20Try to do at least a "fast" icon loading for all itemsFrank Reininghaus
If all icons for the visible items could be loaded in 200 ms, we continue loading icons without mime type determination for all items until the 200 ms are over. This reduces the risk that the user ever sees "unknown" icons. REVIEW: 111011
2013-06-20Make sure that all visible items have an iconFrank Reininghaus
We try to determine "final" icons, i.e., icons with known mime type, for 200 ms. If this does not succeed, we at least load "fast" icons, i.e., load the icons without determining the mime type. REVIEW: 111009
2013-06-20Simplify handling of preview jobsFrank Reininghaus
This patch changes two things about the way we handle the preview jobs: (a) Rather than passing a KFileItemList to startPreviewJob(), remembering the leftovers in the member variable m_pendingPreviewItems and then starting a new preview job for these, we append items that need a preview to this member, and let startPreviewJob() take its input from there. This simplifies the code greatly. (b) To prevent that we start preview jobs with just one item and also that the GUI is frozen too long by startPreviewJob(), we take the following approach: * If the mime type of the first pending item is known, the function has probably been called by startUpdating(), which has determined mime types for the visible items already. startUpdating() has also blocked the GUI, so we just take all items at the beginning of the list with known mime type, and do not do any expensive mime type determination in startPreviewJob(). * If the mime type of the first pending item is unknown, the function has probably been called by slotPreviewJobFinished(). In that case, we can afford to block the GUI for a short while, so we determine mime types for 200 ms. REVIEW: 111008
2013-06-07Remove unused argumentFrank Reininghaus
I saw a runtime warning from QMetaObject::invokeMethod() that KJob* is not a registered type. Since we don't use that argument in slotPreviewJobFinished(KJob*) anyway, it's best to remove it.
2013-06-05KFileItemModelRolesUpdater: waste less ressources and fix some bugsFrank Reininghaus
The main change in this commit is that we do not determine expensive roles (like previews, mime types, etc) for all items, but only for the visible ones and those close to the visible area or on the first and the last page of the view. This prevents that the CPU and hard drive are kept busy for quite some time after entering a folder while all items are handled asynchronously. There is one known problem at the moment: when sorting by "Type" or another role that can be resolved by KFileItemModelRolesUpdater, the icons of the visible items are sometimes not loaded while the sorting is still in progress. I will try to fix this issue during the next few days. REVIEW: 110839
2013-04-22Always determine icons for the visible items firstFrank Reininghaus
When entering a folder, KFileItemModelRolesUpdater has not yet been informed about the visible index range by the view when it tries to determine icons synchronously. This resulted in the problem that it tried to determine icons for all items in random order, and some visible icons were somtimes still unknown after the "synchronous icon loading" timeout of 200 ms. This commit tries to improve the situation by loading icons starting with the first item in increasing order. This should make it less likely that some visible items still have unknown icons after 200 ms. BUG: 316129 FIXED-IN: 4.10.3 REVIEW: 109843
2012-10-15Port Dolphin from Nepomuk to Nepomuk2 according to the Nepomuk2Port mini ↵Emmanuel Pescosta
guide on techbase - http://techbase.kde.org/Projects/Nepomuk/Nepomuk2Port REVIEW: 106825