┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
AgeCommit message (Collapse)Author
2018-10-10Update hidden state correctlyThomas Surrel
Summary: When renaming a file from '.hidden' to 'not_hidden', the file would still be displayed like a hidden file with a semi-transparent icon and a grey text. BUG: 399599 Reviewers: #dolphin, elvisangelaccio Reviewed By: elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D16115
2018-09-11Revert "[KFileItemModelRolesUpdater] Avoid duplicate indexes to resolve"Kai Uwe Broulik
Sometimes causes the first thumbnail to not be loaded :/ This reverts commit 033eb6b3a35ca60ce78ce7ccfeeec26d70205aa8.
2018-09-11[KFileItemModelRolesUpdater] Avoid duplicate indexes to resolveKai Uwe Broulik
This avoids requesting a thumbnail twice for certain files, typically the first or last one in a folder. Differential Revision: https://phabricator.kde.org/D15404
2018-09-10Merge branch 'Applications/18.08'Kai Uwe Broulik
2018-09-10Do use QIcon::Selected for non-icon viewKai Uwe Broulik
Fixes a regression introduced by not using the selected state. The views other than icon view actually do have a proper highlighted background. Differential Revision: https://phabricator.kde.org/D15387
2018-09-06Make thumbnail frame-and-shadow drawing criteria match those of the file dialogNathaniel Graham
Summary: KIO's file dialog already has logic to avoid drawing frames around images detected as likely to be icons, which is improved with D15071. Since Dolphin doesn't use KIO for any of this (boo) we have to pull it over here too; this patch brings the same feature to Dolphin, as well as the feature to disable frames and shadows for all thumbnails at very small sizes, which improves clarity. With this patch, Dolphin's frame drawing behavior becomes consistent with that of the file dialog (as of D15071). BUG: 295526 FIXED-IN: 18.12.0 Test Plan: Icons no longer have frames: {F6214279} Images without transparency still have frames: {F6214280} Nicer presentation for folders with mixed image types (images without transparency get frames; images without it don't): {F6214278} At small sizes, thumbnail clarity is improved by omitting the frame and shadow. Before: {F6214296} After: {F6214294} Reviewers: #dolphin, broulik, elvisangelaccio Reviewed By: #dolphin, broulik, elvisangelaccio Subscribers: markg, anthonyfieroni, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D15069
2018-09-05Merge branch 'Applications/18.08'Kai Uwe Broulik
2018-09-05[KStandardItemListWidget] Round to icon size before applying scalingKai Uwe Broulik
Otherwise for 22px icons on high dpi we will request either the wrong icons or scale them needlessly. Dolphin requests a pixmap of 22px, this is then multiplied by dpr resulting in 44 which isn't a valid icon size (only 32 or 48 are). Moreover, we will also hit the path where it will scale the pixmap to a proper icon size resulting in blurry icons (and a performance penalty). Differential Revision: https://phabricator.kde.org/D15260
2018-09-04Merge branch 'Applications/18.08'Kai Uwe Broulik
2018-09-04Don't use QIcon::Selected state for selected iconKai Uwe Broulik
This causes selected monochrome Breeze icons to turn white as this state is meant for when the icon is actually painted ontop of e.g. a blue highlighted area in a menu Since the advanced icon configuration (where you could choose a custom hint color and other effects) has been removed in Plasma 5.13 and more importantly the fact that Dolphin always tints the icon in the highlight color disregarding any custom icon effects settings this is an acceptable change. CHANGELOG: Fixed monochrome icons turning invisible when selected BUG: 398014 FIXED-IN: 18.08.2 Differential Revision: https://phabricator.kde.org/D15255
2018-08-30Fix minor EBN issuesYuri Chornoivan
2018-08-20Read UDS entry times directly and pretty-print on-demandKai Uwe Broulik
This avoids creating a QDateTime object with all the timezone processing that comes with it since we're only interested in the actual pretty date once we show the role to the user. Differential Revision: https://phabricator.kde.org/D14880
2018-08-16Pretty-print "creationtime" roleKai Uwe Broulik
It was forgotten and would show up as ISO date string instead of human-readable string. Differential Revision: https://phabricator.kde.org/D14878
2018-07-26Compare UDS entry times directly instead of going through KFileItemKai Uwe Broulik
This avoids creating a QDateTime object with all the timezone processing that comes with it since we're only interested in the relative order, not absolute precise date time values. CHANGELOG: Sorting files by date is significantly faster now Differential Revision: https://phabricator.kde.org/D14394
2018-07-19[KItemListSelectionToggle] Adjust painting icon for high dpi scalingKai Uwe Broulik
Instead of using KIconLoader which currently doesn't support high dpi scaling, use QIcon::fromTheme which can. Differential Revision: https://phabricator.kde.org/D14222
2018-07-18Fixes memory leak in KItemListViewAccessibleDavid Hallas
Summary: The KItemListViewAccessible class has a list of QAccessibleInterface pointers in a member variable m_cells. The problem is that when new entries are created, the newly allocated pointer is not stored in the list, only a nullptr is store, this renders the cleanup code in the destructor useless. This patch simply stores the pointer in the list, causing the destructor to correctly free the memory. Test Plan: I found this issue using address sanitizer. Simply building Dolphin with -fsanitize=address and opening a window caused the memory leak. Reviewers: #dolphin, jtamate, elvisangelaccio Reviewed By: #dolphin, jtamate, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D14168
2018-07-14Speedup sortJaime Torres
Summary: Uses a reference to the collator instead of copying and reinitializing it again and again. This is the reason for the speedup. Changing the implementation from a Functor class to a Lambda removes some boilerplate code, but is not relevant for performance. This requires a workaround for https://bugreports.qt.io/browse/QTBUG-69361 Just a single comparison to force the clean state of QCollator. Test Plan: Sorting in a directory with 82874 images: [TIME] Sorting: 19883 (before) [TIME] Sorting: 4198 (after) kfileitemmodelbenchmark before: .............. Passed 29.36 sec kfileitemmodelbenchmark after: .............. Passed 20.39 sec Reviewers: #dolphin, #frameworks, markg, elvisangelaccio, bruns Reviewed By: #dolphin, markg, elvisangelaccio Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D13814
2018-07-14Revert to change the commit message.Jaime Torres
Summary: This reverts commit 765cc968c9dfbd4350226b775377506135c0442d. Test Plan: revert-hammer Reviewers: Subscribers:
2018-07-13Speedup sortJaime Torres
Summary: Use a lambda function to use only one QCollator initialized only once. This requires a workaround for https://bugreports.qt.io/browse/QTBUG-69361 Just a single comparison to force the clean state of QCollator. Test Plan: Sorting in a directory with 82874 images: [TIME] Sorting: 19883 (before) [TIME] Sorting: 4198 (after) kfileitemmodelbenchmark before: .............. Passed 29.36 sec kfileitemmodelbenchmark after: .............. Passed 20.39 sec Reviewers: #dolphin, #frameworks, markg, elvisangelaccio, bruns Reviewed By: #dolphin, markg, elvisangelaccio Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D13814
2018-07-11[KFileItemModelRolesUpdater] Fix preview scaling for frameless previewsKai Uwe Broulik
Follow-up to D11319 for e.g. folder previews Differential Revision: https://phabricator.kde.org/D14047
2018-07-11[KStandardItemListWidget] Avoid needless image resizingKai Uwe Broulik
There be rounding errors when scaling pixmaps when keeping aspect ratio Differential Revision: https://phabricator.kde.org/D11319
2018-07-07A complete build does not fix the crashes I'm having.Jaime Torres
I prefer to wait until QQCollator is thread safe or someone discovers why this is happening now and not before. Summary: This reverts commit 63825de82f3adc9376b0f0f27e24e21bccf62e2a. Test Plan: revert-hammer Reviewers: Subscribers:
2018-07-06Speedup sortJaime Torres
Summary: Use a lambda function instead of a class. This way the member QCollator is not copied and initialized several times. Test Plan: Sorting in a directory with 82874 images: [TIME] Sorting: 19883 (before) [TIME] Sorting: 4198 (after) kfileitemmodelbenchmark before: .............. Passed 29.36 sec kfileitemmodelbenchmark after: .............. Passed 20.39 sec Reviewers: #dolphin, #frameworks, markg, elvisangelaccio Reviewed By: #dolphin, markg, elvisangelaccio Subscribers: elvisangelaccio, apol, bruns, markg, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D13814
2018-07-04Use more nullptrFriedrich W. H. Kossebau
2018-06-06Merge branch 'Applications/18.04'Kai Uwe Broulik
2018-06-06[KBalooRolesProvider] Support properties of type QStringListKai Uwe Broulik
QVariant::toString() unwraps a QStringList with a single string to a QString, however a list with multiple entries returns a null string. Explicitly check for KFileMetaData property type and convert accordingly. BUG: 395033 FIXED-IN: 18.04.3 Differential Revision: https://phabricator.kde.org/D13349
2018-05-22Properly sort int rolesKai Uwe Broulik
Use integer comparison for word count, line count, track, and release year. BUG: 394355 Differential Revision: https://phabricator.kde.org/D12948
2018-04-08use the same bound check as setCurrentItem when setting m_currentItem manuallyFabian Kosmale
Summary: This patch basically adds the check that would normally be done to the itemInserted method, which seems to be good idea in general. However, the fact that this is needed there might be an indicator of a logic bug in the function – though, as I'm not familiar with the code base I cannot judge this. Test Plan: Without this patch, dolphin when started from a terminal prints the following warning (number can be different): qt.accessibility.core: Cannot create accessible child interface for object: PlacesView(0x563e863e35c0) index: 10 After applying the patch, the warning doesn't appear anymore. Dolphin still works still as it did before. Reviewers: elvisangelaccio, #dolphin Reviewed By: elvisangelaccio Subscribers: #dolphin Differential Revision: https://phabricator.kde.org/D11990
2018-04-01Split Image Size into Width/HeightJulian Schraner
Summary: This patch splits the single property "Image Size" into "Width" and "Height", providing more fine-tuned control for power users. FEATURE: 374559 Test Plan: - Sorting works correctly - No real change, only exposed differently Reviewers: #dolphin, elvisangelaccio, ngraham Reviewed By: #dolphin, elvisangelaccio, ngraham Subscribers: ngraham, elvisangelaccio Differential Revision: https://phabricator.kde.org/D11816
2018-04-01Use rightRef() instead of right()Elvis Angelaccio
As recommended by the clazy qstring-ref check.
2018-03-29Fix alignment of icons in Places panel and Compact view modeScott Harvey
Summary: Adjust calculation of icon pixmap Y value; now based off center of text label bounding rectangle. Previously, icons appeared top-aligned when text size was larger than icon size. Centering is done by obtaining the center point of the text frame (`m_textRect.center().y()`) and setting the top `Y` point of the icon to one-half of the scaled icon height (`m_scaled_PixmapSize.height()`) Division is done by `2.0`, to ensure calculations are done with floating-point math, in keeping with `QPointF`, which returns floating-point values. Also includes an adjustment named `midlineShift` (contributed by @zzag), which takes into account the font's midline in respect to the center of the text frame. Certain fonts (i.e. Noto Sans) can have a slightly offset midline, resulting in imperfect alignment of the icon. This small adjustment resolves that potential issue. See before and after screenshots. {F5764918} Before, showing misalignment (with and without debugging wireframes) {F5764920} After, showing correction BUG: 390771 Test Plan: -- Compile Dolphin with patch -- Increase system font size by several points (i.e. 15pt) -- Check that Places panel icons remain centered with the text label -- Select Compact View mode -- Adjust icon size slider to minimum -- Ensure that icons also remain centered in file listing -- Check several combinations of icon size & font size to ensure centering is consistent Reviewers: #dolphin, ngraham, cfeck, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: zzag, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D11650
2018-03-29Merge branch 'Applications/18.04'Elvis Angelaccio
2018-03-29Fix enum-compare-switch clang warningsElvis Angelaccio
We were comparing a value of type `KStandardItemListView::ItemLayout` with values of type `KStandardItemListWidget::Layout`.
2018-03-29[KItemListView] Check if KItemListStyleOption actually changed before ↵Kai Uwe Broulik
emitting a change This avoids work being done when it doesn't need to be. For instance, the preview generator waits for everything to have settled using a 200ms timer before generating a preview. This timer fired also in response to onStyleOptionChanged and needlessly delayed preview generation when navigating between folders despite the style option (e.g. icon size, view mode) not having changed. Differential Revision: https://phabricator.kde.org/D11481
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
2018-02-05[KStandardItemListWidget] Adjust painting rating to device pixel ratioKai Uwe Broulik
Differential Revision: https://phabricator.kde.org/D10324
2018-02-04Fix all krazy #include warningsElvis Angelaccio
- "include own header first line" - "put config.h in angle brackets line" - "do not include QtModule/QtClass line" `QElapsedTimer` was implicitly included by kfileitemmodelsortalgorithm.h, now we need to explicitly include it in kfileitemmodel.cpp. We also need to explicitly link to `Qt5::Concurrent`, otherwise we cannot `#include <QtConcurrentRun>`.
2018-02-04Use qplatformdefs wrappersElvis Angelaccio
As recommended by krazy and as kio does.
2018-02-03Fix all 'explicit constructor' krazy warningsElvis Angelaccio
2018-02-03Add newline at the end of kitemmodelbase.cppElvis Angelaccio
As recommended by krazy. GIT_SILENT
2018-01-29base scrolling on the smallest itemMarco Martin
Summary: CCBUG: 386379 after recent highdpi patches on scrolling that delegated it completely to the scrollbar, based upon the scrollbar singleStep setted to the tallest of the items in the view. tough this makes scrolling way too fast, and on folders where just few filenames are longer than most we can get a single scrolling step almost double the number of lines configured in the mouse kcm. Using the shortest item instead of the tallest mitigates this problem making it a bit more usable Test Plan: tested on different folders in different view modes both with mouse and touchpad Reviewers: #dolphin, broulik, ngraham Reviewed By: #dolphin, ngraham Subscribers: ngraham, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D10102
2018-01-27Port away from deprecated QStyle::SH_Widget_AnimateElvis Angelaccio
Summary: Use the new QStyle::SH_Widget_Animation_Duration instead, which allows us to not manually hardcode the duration. We still use 1 if animations are disabled, otherwise the scroll would not work at all. See also D5883 for some background. Test Plan: Played with different values in the Animation tab of the Breeze config dialog. Reviewers: #dolphin, broulik Reviewed By: broulik Subscribers: broulik Differential Revision: https://phabricator.kde.org/D10005
2018-01-23Add option to sort for original dateJulian Schraner
Summary: Takes the original date a photo was taken out of the data provided by Baloo & makes it available to the user FEATURE: 303645 {F5671033} Test Plan: - Works with a batch of time-tagged photos - Can be hidden/shown/sorted like any other property Reviewers: #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: elvisangelaccio, ngraham Differential Revision: https://phabricator.kde.org/D10059
2018-01-18Merge remote-tracking branch 'origin/Applications/17.12'Luca Beltrame
Conflicts: CMakeLists.txt [versions] src/panels/places/placesitemmodel.cpp
2018-01-11[KStandardItemListWidget] Don't paint overlay outside view for ↵Kai Uwe Broulik
devicePixelRatio > 1 Translate the position by devicePixelRatio REVIEW: 129084