┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private/kdirectorycontentscounter.cpp
AgeCommit message (Collapse)Author
2023-09-10Replace qAsConst with std::as_constMéven Car
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-06-13Settings Add ViewModes > Content displayMéven Car
This does not move the settings location in files though. baby step for https://invent.kde.org/system/dolphin/-/issues/36
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
2020-11-07KDirectoryContentsCounter: fix support of symlinks dirMéven Car
BUG: 428712 FIXED-IN: 20.12
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.
2020-07-06Port away from QLinkedListElvis Angelaccio
`QLinkedList` has been deprecated and should not be used in new code. Port to `std::list` instead.
2020-05-31Fix FIFO usageElvis Angelaccio
`m_propriorityQueue` and `m_queue` are used as FIFO queues, so we need to use `takeFirst()` instead of `takeLast()` when removing elements from the queue. While at it, add a comment so that we will remember these are FIFO queues.
2020-05-25KDirectoryContentsCounter: scan first path not in cacheMéven Car
Use a secondary QLinkedList to store the priority path.
2020-05-20KDirectoryContentsCounter: don't schedule scanning a folder already in the QueueMéven Car
Use a QLinkedList to check for presence in the queue. merge request !2
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
2020-01-11Add only canonical paths to dirWatcherRobert Hoffmann
Summary: KDirWatch only works correctly with canonical paths, i.e. symbolic links resolved. Test Plan: 1. Create dirs: $ mkdir test1 $ mkdir test1/subdir $ ln -s test1 test2 2. Start dolphin, navigate to test2/subdir, then in terminal: $ echo test > test2/subdir/test Without the patch, test2/subdir/test won't be shown automatically, only after reload (F5). With the patch applied, test2/subdir/test will be shown automatically. 3. Restart dolphin, navigate to test2/subdir, then in terminal: $ echo test >> test2/subdir/test Without the patch, the increased size of test2/subdir/test won't be shown automatically, only after reload (F5). With the patch applied, it will be shown automatically. 4. Restart dolphin, navigate to test2/subdir, then in terminal: $ rm test2/subdir/test Without the patch, test2/subdir/test stays visible, will only disappear after reload (F5). With the patch applied, it will disappear automatically. Reviewers: dfaure, #dolphin, elvisangelaccio Reviewed By: dfaure, #dolphin, elvisangelaccio Subscribers: ngraham, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25732
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-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
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
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-04-03KDirectoryContentsCounter: do not delete currently active worker objectsFrank Reininghaus
Before this patch, the destructor of KDirectoryContentsCounter might delete the worker object, which lives in another thread, while one of its methods was still being executed. This could cause a crash. Only if the destroyed KDirectoryContentsCounter was the last one, the worker thread was stopped, and the destructor waited until all workers are done. BUG: 332767 FIXED-IN: 4.13.0 REVIEW: 117209
2014-01-21Use only one "directory contents counting" thread per processFrank Reininghaus
The pointer to QThread object is stored in a global variable, and each view increments/decrements a reference count when it starts/stops using the thread. If this thread reaches zero, the thread is stopped. Note that we cannot just use a smart pointer, like QSharedPointer, to manage the thread, because we must make sure that the thread is not running any more before the QThread is deleted. REVIEW: 115064
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