┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kstandarditemlistwidget.cpp
AgeCommit message (Collapse)Author
2016-03-16[CLAZY] Fixed all level 1 and level 2 warnings with small exceptionsArtur Puzio
REVIEW: 126771
2015-03-27review commentsDavid Edmundson
2015-03-25Paint icons at the correct sizeDavid Edmundson
2015-02-24Removed unused KGlobal includes and use KIO/Job instead of KIO/JobClassesEmmanuel Pescosta
2015-02-06Fix includesMontel Laurent
2014-11-10get rid of unused warningsEmmanuel Pescosta
2014-10-27Port to QDebug*. KVBox--Montel Laurent
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-18Fix includesMontel Laurent
2014-10-18Fix includesMontel Laurent
2014-09-12Ported KIcon to QIconEmmanuel Pescosta
REVIEW: 120159
2014-08-22Merge branch 'master' into frameworksEmmanuel Pescosta
Conflicts: dolphin/src/dolphinmainwindow.cpp dolphin/src/dolphinmainwindow.h dolphin/src/dolphinrecenttabsmenu.cpp dolphin/src/dolphinviewcontainer.cpp kfind/CMakeLists.txt
2014-08-04Fix wrong text eliding in some corner cases.Emmanuel Pescosta
BUG: 337104 FIXED-IN: 4.14.0 REVIEW: 119546
2014-07-04Merge branch 'master' into frameworksLuca Beltrame
2014-07-04Improve drawing selected items in Compact/Details View and Places PanelFrank Reininghaus
This commit removes the icon tinting for the selected item in Compact and Details View, and extends the selection rectangle such that it includes the icon area as well. The icon tinting can be disturbing, and having a selection rectangle that only includes the text can look a bit strange, especially in the Places Panel. BUG: 304643 REVIEW: 119018 FIXED-IN: 4.14.0
2014-06-29Remove the automoc noiseChristophe Giboudeaux
2014-06-05Merge remote-tracking branch 'origin/master' into frameworksFrank Reininghaus
2014-06-05Separate width and height info in the layouting codeFrank Reininghaus
By separating the width and height info, we can save some unnecessary overhead in terms of memory and CPU cycles, and make the calculation of the height of a row (or the width of a column in Compact View) a bit simpler. To achieve this, this patch extends the concept of "logical rows" (which are actually columns in Compact View) to "logical width" and "logical height" (which is the actual height and width, respectively, in Compact View). The distinction between rows/columns and "logical" rows/columns may be a bit confusing, but the confusion is already in the current code, and I hope that it will be mitigated a bit by prefixing the corresponding variables with "logical". REVIEW: 118454
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-14Merge branch 'KDE/4.12' into KDE/4.13Frank Reininghaus
2014-04-14Update the "is cut" state of items if necessaryFrank Reininghaus
The icons of items which are "cut" are shown faded in the view. The "is cut" state of the widget representing an item is updated if the clipboard contents change. Before this commit, if the sort order was changed however, then each widget kept the "is cut" state of the item which had been shown previously at its position. The solution is to update the "is cut" state also if any of the widget's data change. BUG: 332792 REVIEW: 117451 FIXED-IN: 4.12.5
2014-03-05Fix Bug 326210 - Dolphin unnecessarily truncates names of soft links in ↵Emmanuel Pescosta
compact mode FIXED-IN: 4.13.0 BUG: 326210 BUG: 310592 REVIEW: 116121
2014-02-24Make the handling of the "maximum text lines" setting more robustFrank Reininghaus
If the user sets a maximum number of text lines in the settings, this number was translated into a maximum height in pixels using QFontMetrics::lineSpacing() before this commit. In KStandardItemListWidgetInformant::itemSizeHint(), this maximum height limited the size that is reserved for the item. However, in KStandardItemListWidget::updateIconsLayoutTextCache(), the maximum height was translated back into a maximum number of lines, which limits the number of lines that are created using the QTextLayout. This approach could lead to problems if the real height of the layouted text is 1 pixel more or less than QFontMetrics::lineSpacing() times "number of lines". Now we do not store a "maximum height" inside the "maximum size" explicitly, but store a maximum number of lines and a maximum with (for Compact View) separately, and then use the number of lines also to calculate the required size in KStandardItemListWidgetInformant::itemSizeHint(). This should make sure that the correct height is reserved for each item. Thanks to Christoph Feck and Emmanuel Pescosta for helping to debug this problem and testing the patch. BUG: 323841 FIXED-IN: 4.13 REVIEW: 113871
2014-01-12Calculate all item size hints at once.Emmanuel Pescosta
The speed up is really small, but theses changes are mostly straightforward and make the code a bit nicer - break the KStandardItemListWidgetInformant::itemSizeHint beast into three smaller functions. FIXED-IN: 4.13 REVIEW: 112979
2013-12-02Lazy-load the item data also in Compact ViewFrank Reininghaus
The recent changes which prevent that all data for each item are saved in a QHash already when loading the folder (see https://git.reviewboard.kde.org/r/112725/), which save both memory and time, do not work yet in Compact View, because KItemListWidgetInformant::itemSizeHint() calls the model's data(int) method for every item, which then initializes the hash. This patch prevents that by accessing the file name directly if only the "Name" is shown in the view, just like it's done in Icons View. REVIEW: 113849
2013-10-09Use the icon size from KItemListStyleOption for the width and height of theEmmanuel Pescosta
expansion area instead of KIconLoad::SizeSmall. BUG: 325543 REVIEW: 113169 FIXED-IN: 4.12
2013-09-04Try to avoid calling the model's data method if only "text" is neededFrank Reininghaus
Currently, KStandardItemListWidgetInformant::itemSizeHint() calls the model's data(int) method for every single item, but the full data is actually only needed for the size calculation in Compact View. In Details View, no data is needed at all to determine the size required for the item, and in Icons View, only the name is needed. This patch makes it possible for subclasses of KStandardItemListWidgetInformant to provide an alternative way to obtain the "text", and implements this in the subclass KFileItemListWidgetInformant. The final goal is to achieve that the QHash which contains all data for a file item is only created if it is really needed, e.g., because the view needs access to the data for displaying the item on the screen. REVIEW: 112253
2013-08-25Fix filename trucation issues in Icons View with maximum number of linesFrank Reininghaus
When the name of a file is too long to be shown inside the maximum number of lines, the last line is elided. However, there were several problems before this commit: (a) "lastTextLine", which contains the text to be elided, was not assigned the complete remaining text, but only the part that would be put into the last line if there were more lines following. This may be less than what would fit into the line because we try to not break the text at random points. (b) QFontMetrics::elidedText() was not given the width that is available for the last line (that would be maxWidth), but only the width that would be occupied by the text if there were more lines following (line.naturalTextWidth()). (c) The variable "nameWidth", which is required to calculate the QRectF that is reserved for the name, was not updated correctly. The result is that the text was sometimes trucated too early (especially if there would be a line break early in the text if we had more lines available), that there may be insufficient space to show the "...", and that the hover/selection rectangle might be too narrow. BUG: 304558 BUG: 321882 FIXED-IN: 4.11.1 REVIEW: 112265
2013-08-24Delay the deletion of the role editor as long as possibleFrank Reininghaus
This should prevent crashes that can be caused if the view is closed in a nested event loop that is run from the role editor. BUG: 322969 FIXED-IN: 4.11.1 REVIEW: 111988
2013-08-14Do not store default values in QHash<QByteArray, QVariant>Frank Reininghaus
Storing values which are equivalent to default-constructed QVariants does not make much sense because QHash::value returns the same value even if the corresponding key is not found in the hash. This commit reduces Dolphin's memory consumption in large folders by up to 7.3% (tested a folder with 100,000 files in Details View) and reduces the time required for loading a folder. BUG: 323517 FIXED-IN: 4.11.1 REVIEW: 111922
2013-08-14Fix slow scrolling when hidden files or symbolic links are shownFrank Reininghaus
The problem was that we drawed the overlays using KIconLoader, which can be very slow, every time an item appeared on the screen. This commit makes sure that not only the icon, but the icon including overlays is cached in QPixmapCache. Therefore, the overlay drawing is done just once for each icon+overlays combination. For previews, the overlay drawing is done in KFileItemModelRolesUpdater just after the preview is received. BUG: 310662 BUG: 314339 FIXED-IN: 4.11.1 REVIEW: 111956
2013-06-26Remove the space (1 pixel) between the file name and the fileEmmanuel Pescosta
icon in Compact View and Details View mode. BUG: 320899 FIXED-IN: 4.11.0 REVIEW: 111244
2013-06-10Do not rename files unexpectedly when changing the URLFrank Reininghaus
If the role editor loses focus, it considers the current renaming operation finished, and tells DolphinView to rename the file. This is a problem when changing the directory, because the URL change happens before DolphinView receives the signal, which results in a file in the new directory being renamed unexpectedly. The solution is to establish the connection to the slotRoleEditingFinished signal only when the "rename inline" editor is opened, and disconnect it when renaming is finished or canceled or the URL changes. BUG: 319912 FIXED-IN: 4.10.5 REVIEW: 110908
2013-05-02Use the same text color for selected hidden and non-hidden itemsFrank Reininghaus
This fixes the problem that the names of selected hidden items are unreadable with some color schemes. BUG: 305734 FIXED-IN: 4.10.3 REVIEW: 110164
2013-04-12Fix moving image while transitioning to hover pixmapAurélien Gâteau
See: http://youtu.be/OMYO0U0kSL0 REVIEW: 109960 FIXED-IN: 4.10.3
2013-03-21Fix transition between m_pixmap and m_hoverPixmapAurélien Gâteau
The default SourceOver composition mode of QPainter cannot be used to interpolate between two images, we must use intermediate buffers to perform the interpolation and blend the result on the widget. More details are available in the review request. REVIEW: 109614 FIXED-IN: 4.10.2
2013-02-11Fix blinking when moving the mouse over an hidden itemAurélien Gâteau
The opacity of the unhovered pixmap must be gradually reduced while animating otherwise the alpha channel saturates. REVIEW: 108858 BUG: 299371 FIXED-IN: 4.10.1
2013-01-11Slightly reduce the tinting for selected icons and previewsFrank Reininghaus
The intention of the tinting was to make it more obvious in icons view which icons are selected. However, some icons and previews look quite ugly with the current tinting value of 1.0 (i.e., the value passed to KIconEffect::colorize). A slight reduction of this value to 0.8 makes this a little less ugly. However, the real fix is to remove the tinting altogether and find something better to indicate which items are selected. CCBUG: 309722
2012-12-07Merge remote-tracking branch 'origin/KDE/4.9'Frank Reininghaus
2012-12-07Fix keyboard focus handling after renaming items inlineFrank Reininghaus
This reverts 951cb9c35d7a9ef814b3de5b359915968da9b881 and 3143acc084d54d43df469b54762bfa10a7050a9f, and fixes the crash caused by nested event loops by delaying the deletion of the KItemListRoleEditor until the next item is renamed inline. BUG: 311206 FIXED-IN: 4.9.5 REVIEW: 107606
2012-11-05Merge remote-tracking branch 'origin/KDE/4.9'Frank Reininghaus
2012-11-05Prevent crashes caused by nested event loops run when renaming inlineFrank Reininghaus
When renaming inline and starting a drag or invoking the context menu, a nested event loop will be run. If the role editor loses focus and emits roleEditingFinished(), we must prevent that deleteLater() is called because this would delete the role editor inside a nested event loop which is run from one of its own functions. We would get a crash when returning from that event loop otherwise. BUG: 308018 BUG: 309421 FIXED-IN: 4.9.4
2012-10-30Fix some indentation issuesFrank Reininghaus
2012-10-26Merge remote-tracking branch 'origin/KDE/4.9'Christoph Feck
2012-10-26Fix color role of tree view arrowsChristoph Feck
BUG: 307734 FIXED-IN: 4.9.3 REVIEW: 107031
2012-10-25Use QPixmapCache for KStandardItemListWidget::pixmapForIcon(const QString& ↵Emmanuel Pescosta
name, int size) -> Avoid KIcon loading and rescaleing REVIEW: 107039
2012-09-24Revert part of 20b0cb68bf5cc1099fd6e61982817d9e2ae0130cFrank Reininghaus
That commit, which disregarded roles with empty text for the row number calculation in Icons View, caused the problem that icons might jump around while information was retrieved asynchronously because previously empty roles could get a non-empty value, and the corresponding items would need an additional row in the view. Thanks to Hrvoje Senjan for testing this feature in master and reporting this issue early, such that we could fix it quickly and prevent that other users suffer from this bug! CCBUG: 304752
2012-09-21Merge branch 'KDE/4.9'Luca Beltrame
Conflicts: konq-plugins/dirfilter/dirfilterplugin.cpp konq-plugins/dirfilter/dirfilterplugin.h
2012-09-11Fix possible crash in KStandardItemListWidget::paint()Frank Reininghaus
According to the backtrace in the bug report, it is possible that KStandardItemListWidget::paint() is called if the hash m_textInfo has not been initialised. The widget's index must be -1 in this case, see KStandardItemListWidget::triggerCacheRefreshing(). It looks like this can only happen if the item is about to be removed from the view, see KItemListView::slotItemsRemoved(). I could not reproduce the crash, so I'm not sure why exactly this happens, but this commit should at least prevent the crash. BUG: 306167 FIXED-IN: 4.9.2