┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2013-10-13Fix crash when triggereing the "Compare files" action via D-BusFrank Reininghaus
If the number of selected items is not two, Dolphin disables this action. However, it is still possible to trigger it via D-Bus, and this could cause a crash in DolphinMainWindow::compareFiles() because this function did not test at all if there are really two items selected. This patch adds such a check and simplifies the code in that function. BUG: 325517 FIXED-IN: 4.11.3
2013-10-13Files passed as arguments: Ignore unsupported filesErik Hahn
With this patch, Dolphin ignores all files passed to it that it can't Also, archives are now opened inside Dolphin so it can be used as an archive manager at least for local files. If the user tries to open a remote archive Dolphin still opens it externally; I have observed that if it receives one as an argument, it will display a pseudo-folder that contains only said archive. So having it set as the archive handler is still broken, but in a less annoying way. CCBUG: 318683 REVIEW: 113191 FIXED-IN: 4.11.3
2013-10-07Reload the view if a previously unmounted device is mounted againFrank Reininghaus
The problem was that DolphinViewContainer::setUrl(newUrl) was ignored if newUrl is equal to the URL which is shown in the view already. The new approach is to reload the view in that method if it is empty, to make sure that we do not miss that a previously unmounted device has been re-mounted. Thanks to Grigoriadis Grigoris for analyzing the root cause of this issue! BUG: 161385 FIXED-IN: 4.11.3
2013-10-07Include "Space" in the keyboard search stringFrank Reininghaus
Before this commit, we only added pressed keys to the search string if they have no other meaning. This means that files containing a Space in their name could not be searched because Ctrl+Space toggles the selection state of the current item, and Space alone selects the current item. After this commit, Space is added to the search string if (a) the key press did not have any other effect, i.e., if Ctrl was not pressed, and the current item is selected already, and (b) a keyboard search has been started already (to prevent unexpected effects when pressing Space accidentally - I think that it's rather uncommon to have files whose names start with a Space - and to make the unit test simpler). I modified the unit test of KItemListController, which did not test keyboard search yet. This uncovered a small problem in KItemListController::slotChangeCurrentItem() when NoSelection mode is used. It's not really relevant for anything that is executed inside Dolphin, but I still fixed it to make the unit test happy. BUG: 324479 FIXED-IN: 4.11.3 REVIEW: 113071
2013-10-01Add unit test for the calculation of "name" groups with expanded itemsFrank Reininghaus
This prevents a possible regression that would have happened with the first version of https://git.reviewboard.kde.org/r/112725/ The problem was that isChildItem(int index) would return "false" incorrectly when the QHash for that item was not initialized yet. The grouping code would then try to read the "text" from the empty QHash, which yielded an empty QString, and then accessing the first character of that string caused a crash.
2013-09-29Show the right version states for expanded items.Emmanuel Pescosta
BUG: 267171 FIXED-IN: 4.11.3 REVIEW: 112980
2013-09-29Make sure that removeExpandedItems() also removes filtered itemsFrank Reininghaus
This fixes the problem that filtered child items in Details View may reappear when switching the view mode and the clearing the filter. BUG: 325344 REVIEW: 112962 FIXED-IN: 4.11.3
2013-09-27SVN_SILENT made messages (.desktop file)l10n daemon script
2013-09-14Make preview loading faster when scrollingFrank Reininghaus
KFileItemListView notifies KFileItemModelRolesUpdater of changes of the visible index range and the icon size with a delay, to prevent that expensive operations are triggered repeatedly, and that scrolling feels sluggish because the GUI thread is blocked by icon loading. This patch ensures that the "long" delay of 300 ms is only used when the zoom level is changed, and the "short" delay if only the visible index range has changed. Thanks to Christoph Feck for helping to analyze this problem! BUG: 322093 FIXED-IN: 4.11.2 REVIEW: 112580
2013-09-12Remove "Copy text" statusbar contextmenu entryKai Uwe Broulik
REVIEW: 112355
2013-09-12Fix Bug 311099 - View the underscore when using Ctrl + PagDownEmmanuel Pescosta
Take the style option vertical/horizontal margin into account for the calculation of the new scroll offset. Thanks to Frank for pointing out two other problems with "Page Up/Down" and providing a better way to fix these problems. :) BUG: 311099 FIXED-IN: 4.11.2 REVIEW: 112678
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-09Test if the groups are updated correctly when items are refreshedFrank Reininghaus
This unit test will hopefully prevent regressions in the future. It is the first part of https://git.reviewboard.kde.org/r/112561/.
2013-09-05Fix Bug 296970 - split view wrong behavior with search tabEmmanuel Pescosta
Implemented setActive(bool active), isActive() and activated() signal for DolphinSearchBox - similar to the KUrlNavigator implementation. BUG: 296970 FIXED-IN: 4.11.2 REVIEW: 112534
2013-09-03Fix color role of services listChristoph Feck
Fixes the color of non-selected items to make them readable with every color scheme. BUG: 286459 FIXED-IN: 4.11.2 REVIEW: 112483
2013-08-25Move cursor to begin/end of selection before canceling itChristoph Feck
Makes Left/Right keys consistent with QLineEdit behavior. BUG: 323946 FIXED-IN: 4.11.1 REVIEW: 112256
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-24Adjust the size and position of the selection toggle on iconEmmanuel Pescosta
resize (when changing the zoomlevel). BUG: 310412 REVIEW: 112250 FIXED-IN: 4.11.1
2013-08-24Make determining the mime type faster for foldersFrank Reininghaus
KFileItem::determineMimeType() not only determines the mime type, but also the icon. For folders, it looks for a .directory file inside the folder, where a custom icon might be stored. This can take quite a bit of time and cause the problem that some folder's type still appears to be "unknown" when the view is shown. We can work around this problem by caching the folder mime type in a static QString and applying to to all folders, which can be identified easily with KFileItem::isDir(), BUG: 321710 FIXED-IN: 4.11.1 REVIEW: 111830
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-24Make use of the "resort all items timer" in KFileItemModel::slotRefreshItemsEmmanuel Pescosta
to avoid too much expensive resorting calls, in case of many refresh items signals. Followup to patch 111146 CCBUG: 303873 CCBUG: 299565 BUG: 323789 FIXED-IN: 4.11.1 REVIEW: 111195
2013-08-20Fix crash when failing to get audio CD block deviceChristoph Feck
CCBUG: 314544 REVIEW: 112117
2013-08-15Make sure that the sort order is correct after renamingFrank Reininghaus
KFileItemModel::setData() should not only cause a resorting when the sort role is changed. The name is always used as a fallback if the sort role of multiple files is equal, therefore, renaming a file can change the correct order of the files even if the files are not sorted by "name". Unit test included. BUG: 323518 FIXED-IN: 4.11.1 REVIEW: 111721
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-08-14Fix crash when disabling "Show in groups"Frank Reininghaus
The problem was that items are removed from m_visibleGroups while a QMutableHashIterator iterates over this hash, such that the iterator can become invalid. The solution is to use a QHashIterator instead, which takes a copy of the hash. Therefore, it is not affected if m_visibleGroups is modified in any way. BUG: 323248 FIXED-IN: 4.11.1 REVIEW: 111919
2013-08-05dolphin: Escape text in statusbar tooltipFabio D'Urso
This fixes the same issue as 4450f8449af91e491636728a4669e2a9e27b49fa, but for the status bar's tooltip text. BUG: 323170 FIXED-IN: 4.11.0 REVIEW: 111836
2013-08-05DolphinPart: Use Qt::convertFromPlainText instead of Qt::escape for filenamesFabio D'Urso
Unlike escape, convertFromPlainText preserves whitespace sequences CCBUG: 321778 REVIEW: 111835
2013-08-04Add some unit tests for grouping in KFileItemModelFrank Reininghaus
Hopefully, this will prevent regressions in the future. REVIEW: 111807
2013-08-04Make KFileItemModelTest fasterFrank Reininghaus
The 500 ms timeout before items are resorted does not make much sense in the unit test. Removing this delay makes the test run much faster.
2013-07-29When pasting a folder and expanding it, do not select its childrenFrank Reininghaus
Thanks to Emmanuel for pointing out a problem with my first patch. BUG: 322965 FIXED-IN: 4.11.0 REVIEW: 111722
2013-07-29Don't let HTML-like filenames be interpreted as HTML stringsFabio D'Urso
So that filenames that look like HTML don't get fancy-formatted when we show info about them (i.e. on hover) This patch fixes the same issue in two places: - dolphin, by setting Qt::PlainText on the status bar's label - konqueror, by escaping setStatusBarText strings emitted by DolphinPart BUG: 321778 FIXED-IN: 4.11.0 REVIEW: 111746
2013-07-28Do not convert a KUrl to a QString and back againFrank Reininghaus
This small change saves a lot of CPU cycles when the items are resorted. REVIEW: 111700
2013-07-26Don't open .desktop files with http:/https: urls in Dolphin,Emmanuel Pescosta
open these urls in the default browser instead. BUG: 283475 BUG: 318217 FIXED-IN: 4.11.0 REVIEW: 111674
2013-07-25Fix maximum value for scroll bar when deleting items in Details ViewFrank Reininghaus
The problem was that the view heigt minus the header height was subtracted from maximumScrollOffset() to determine the maximum value of the scroll offset of the top of the view. However, the top of the view is the part that is hiden behind the header. Therefore, the full view height must be subtracted from maximumScrollOffset. The remaining bits of bug 319951 were fixed by other recent commits. Thanks to Emmanuel Pescosta for helping to track down the problem! BUG: 319951 FIXED-IN: 4.11.0 REVIEW: 111486
2013-07-25Prevent that removing items can cause icons to overlapFrank Reininghaus
When items are removed, new items may become visible because of that. This includes (a) Items *behind* the removed range. KItemListView may try to create their widgets at their "imaginary" old positions and move them to the new position with an animation. (b) Items *before* the removed range, if the deletion causes the view to scroll up. In that case, the "imaginary" old position and the new position was equal, but KItemListView still tried to determine the "old" position by adding the number of removed items to the index. The result was that the widgets were created at completely wrong positions, and no animation was started to fix this. Thanks to Emmanuel for helping to find the cause of this bug! BUG: 302373 FIXED-IN: 4.11.0 REVIEW: 111630
2013-07-25SVN_SILENT made messages (.desktop file)l10n daemon script
2013-07-22Do not try to smooth-scroll past the end of the viewFrank Reininghaus
KItemListSmoothScroller::scrollTo(qreal position) did not check if 'position' is a valid value. Even if the view is scrolled to the bottom already, it tried to scroll further and activated "smooth scrolling" when the mouse wheel is used. Because it never got out of the "smooth scrolling" state then, it got confused when changing the directory, and restoring the correct scroll offset could fail. BUG: 322212 FIXED-IN: 4.11.0 REVIEW: 111557
2013-07-22Fix "truncated header" in Details View with non-Oxygen stylesFrank Reininghaus
The code for painting the "empty header" was inconsistent with the headers of the other columns, which is probably the reason why the other styles got confused a) No QStyleOptionHeader is used b) Even if an empty header must be drawn, the last column is drawn with the option QStyleOptionHeader::End. According to Christoph, it still doesn't work with the Skulpture style, but it seems that the patch does at least not make things worse. BUG: 301800 FIXED-IN: 4.11.0 REVIEW: 111608
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-07-05Fix O(N^2) complexity issue in KItemListView::slotItemsRemoved()Frank Reininghaus
If many item ranges are removed, KItemListView::slotItemsRemoved() could take very long because it looped over all items after the first removed one for every removed range, even if most of these items are not visible at all. This commit improves this by just looping over the visible items (whose number is limited by the window size) for each range. Test case (for very large N): touch {1..N}.png touch {1..N}.jpg (wait until all files are shown in the view) rm *.jpg REVIEW: 111398
2013-07-05Keep the "item size hints" of moved itemsFrank Reininghaus
It's quite expensive to re-calculate them, so we should better just move them to the correct position, rather than throwing them away. REVIEW: 111399
2013-07-04Make sure that KItemListSizeHintResolver is always consistentFrank Reininghaus
This was the root cause of bug 317827. The assert tried to make sure that we never access KItemListSizeHintResolver from KItemListViewLayouter inside the loop over the item ranges. This would be dangerous because it might be in an inconsistent state - the removed item ranges were removed step by step, so accessing the item size hints before the operation was finished could lead to wrong results. The solution is to insert/remove all item ranges immediately. A nice side effect is that there are no sources of O(N^2) complexity in KItemListSizeHintResolver any more if many item ranges are inserted/removed. BUG: 317827 FIXED-IN: 4.11.0 REVIEW: 111382
2013-07-02Fix crash when dropping URLs on the URL navigator's drop down menusFrank Reininghaus
The problem was that the files were copied/moved inside the nested event loop of the drag, which caused problems if the "File exists" dialog was shown. The solution is to make the copy/move operation delayed, such that it is executed in the main event loop. Note that dropping files on these menus does apparently not work at the moment when using the Oxygen style (see bug 310016). BUG: 192139 BUG: 256338 BUG: 293220 BUG: 309076 FIXED-IN: 4.11.0 REVIEW: 111273
2013-07-02Make it clear that the Trash/Delete confirmations apply to all KDE appsFrank Reininghaus
FIXED-IN: 4.11.0 REVIEW: 111324
2013-07-02Prevent some unnecessary layoutings when the view size is changedFrank Reininghaus
In Icons/Details (Compact) View, no layouting is necessary if the view height (width) changes. REVIEW: 111322
2013-06-30Replace QList by QVector if the elements are larger than a pointerFrank Reininghaus
If the elements are larger than a pointer, QList does not store the elements themselves, but pointers to them in a contiguous block of memory. This wastes quite a bit of memory. This can be prevented easily by using QVector instead. REVIEW: 111304
2013-06-29Dolphin: Use the Nepomuk2::FileMetaDatConfigWidgetVishesh Handa
Instead of the KFileMetaDataConfigurationWidget REVIEW: 111294