┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabwidget.cpp
AgeCommit message (Collapse)Author
2024-07-01Revert "DragAndDropHelper::updateDropAction: use StatJob for remote URLs"Felix Ernst
This reverts commit dc149ec5e52f52c514cf362603d05ba8eea506b8. This prevents a crash. One issue identified is that the commit that I am reverting here accesses a QDropEvent at a moment in time in which it might have already been deleted. We cannot check if it exists by that time because we do not control its lifetime and it is not a QObject.
2024-03-09Handle deprecation of QGuiApplication::paletteChangedMéven Car
NO_CHANGELOG
2024-02-29DragAndDropHelper::updateDropAction: use StatJob for remote URLsJin Liu
When dragging onto tabs/Places from a remote URL, we don't process the QDropEvent immediately, but start a StatJob and process the event when it finishes. Also, the result of the StatJob is cached for 30 seconds, to avoid starting duplicate jobs.
2024-02-17Improve DnD handling in read-only dirsJin Liu
1. Places panel and tabbar update drag status in read-only dir 2. Don't create drop job in readonly directories
2024-01-14DolphinMainWindow: autosave sessionAmol Godbole
Currently, the session is saved only when the app quits normally. Save the session after a fixed time interval from the last state change i.e. anytime the url is changed, or a tab is opened or closed, or the active view is changed. BUG: 425627
2024-01-13Fix: closing split view doesn't update tab nameJin Liu
BUG: 469316
2023-11-12DolphinTabWidget: Use tabBarAutoHide propertyAmol Godbole
The tab bar was being hidden manually. Instead, set the tabBarAutoHide property to true. BUG: 476742
2023-08-23Merge branch 'master' into kf6Méven Car
2023-08-17Set Maximum Tab Width for folders to Tab barK. Cottonears
There is no limit to the width of tabs with the tab bar of the main window. If the directory name is too long, tabs can take up a lot of space and can lead to inconsistent tab widths. To alleviate this, set a maximum tab bar text width of 40 characters for each folder. BUG: 420870
2023-07-05Merge branch 'master' into kf6Nicolas Fella
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-05-09Fix a bunch of Qt6/Kf6 warningsMéven Car
2023-04-23Add DolphinTabPage::inactiveViewContainer()Eugene Popov
2023-04-23Improve copying and moving items between panelsEugene Popov
Currently, copying the selected items between panels is performed by the active panel, which is wrong, because the inactive panel cannot select the copied items after the operation is completed (as it happens when drag'n'dropping or copying using keyboard shortcuts).
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2023-01-19Use both split view names in tab namesOliver Beard
When the tab is a split view, use the name of both views rather than only the active view.
2022-10-11Rename variableFelix Ernst
Based on code review feedback by Andrey Butirsky.
2022-10-11Add helper methods to tab widget for view containersFelix Ernst
This commit introduces the private getter DolphinTabWidget::viewContainerAt(ViewIndex) and another private method DolphinTabWidget::activateViewContainerAt(ViewIndex). Both methods return nullptr if there is no valid DolphinViewContainer at the specified ViewIndex.
2022-10-11Fix item highlighting through DBusFelix Ernst
Before this commit, even items that are distant children of currently open views were considered selectable. This lead to the bug that items meant to be highlighted through DBus would not be highlighted if any ancestor of the item was open in any view. This was fixed by only considering items in view if they can be seen by scrolling. Main difficulty here was to make this also work for the details view mode which allows expanding. To implement this cleanly, some refactoring seemed necessary because the logic to determine if an item is already in view was previously intertwined with the logic to identify already open directories. This commit also contains the following refactorings aiming to make the code more readable: - A magic value (-1) is replaced using std::optional. - A boolean trap is removed. - A QPair is replaced by a struct with named variables. - More and improved documentation
2022-10-06DolphinTabBar: Open folder in new tab when dropped onto tab barKai Uwe Broulik
2022-10-06DolphinTabWidget: Allow specifying new tab position in openNewTabKai Uwe Broulik
2022-07-09dolphintabwidget.cpp piority of boolean operatorsMarius P
Fix PVS-Studio issue "warning: V648 Priority of the '&&' operation is higher than that of the '||' operation.". Fix clangd issue.
2022-06-22do not open excessive tabAndrey Butirsky
even if directory of the file to be created is not the top-most opened in TreeView BUG: 440663
2022-05-24prevent excessive tab openingAndrey Butirsky
Without this, KIO::highlightInFileManager() will open additional tab even if file to be highlighted is already present in current view
2021-11-13Fix updating window and tab titlesEugene Popov
This MR fixes an issue where the window and tab titles don't properly handle creating/deleting/renaming items in the places bar, as well as switching to the Search mode.
2021-08-30Tabs: ensure to have folder icons for remote foldersMéven Car
KIO::iconForUrl relies on filename to find the icon for remote files. Appending / at the end of the filename allows it to interpret it as a folder. This causes inconsistent tab icons. To reproduce: Open in a tab a url on a smb or sftp folder, i.e sftp:/my-server/photos Before: Icon is a cloud. After: Icon is a folder Previously a folder icon could be presented if the tab was first opened with a url with a trailing /
2021-04-24Remove code for dolphin < 4.14 tab restoreAlexander Lohnau
The old config keys haven't been written for since KDE 4 times and has been internally marked as deprecated.
2021-03-31Fix crash calling openDirectories() in various casesNate Graham
This can cause a crash when called with a single url and split view, or when the last URL is not shown, because the iterator gets mutated in the loop, so we need to make sure it hasn't gone out of bounds. This check was erroneously removed in 175538020824355115cd98637ce83ecc53badd44 and needs to be brought back.
2021-03-26Don't re-open already-open URLs when using session-restore featureNate Graham
If Dolphin would be asked to open a location that is already open, don't open it again in a new tab; instead switch to that view. Supports tabs and split view. BUG: 434911 FIXED-IN: 21.04
2021-01-10Open new tab placement optionAnthony Fieroni
Signed-off-by: Anthony Fieroni <[email protected]>
2020-11-09Adress the third round of Angelaccio's review commentsFelix Ernst
Additionally remove some redundant code concerning UrlNavigator visuals.
2020-11-09Adress most of the second round of Angelaccio's review commentsFelix Ernst
This commit applies most suggestions which were made on the MR. Most notably the DolphinUrlNavigator class is split up which leads to the creation of a DolphinUrlNavigatorsController class. Additionally some minor coding style and const correctness changes are included. The error value of cached integers is changed from -1 to INT_MIN because situations could come up in which -1 would be a valid value.
2020-11-09Fix a crash and extract unrelated changesFelix Ernst
The secondary UrlNavigator is now created when and only when: - split view mode is activated for the active tab OR - switching to a tab that has split view already enabled. This fixes a crash that occurs when the setting to always start in split view mode is enabled. An animation for activating split view is also removed from this and moved into a separate MR. Another unrelated name change left over from a previous commit (viewContainers() -> activeViewContainers()) is dropped.
2020-11-09Make UrlNavigators in the toolbar the only optionFelix Ernst
The UrlNavigators will be automatically added to the toolbar. The Sort By action is removed from the default toolbar to make space. Remove all options to have UrlNavigators outside the toolbar and remove those code paths. Make it so the new NavigatorsWidgetAction contains two UrlNavigators when in split view mode. Spacing was also added to align these UrlNavigators with the ViewContainers when enough space is available. Force the toolbar to be either at the top or bottom of the window. Set a sane sizeHint for DolphinUrlNavigator. It would be better to do this in KUrlNavigator in the future. This commit also contains a changes which should be moved to a separate merge requests before this gets merged: - Add an expansion animation when split view is enabled by the user
2020-11-09Add an option to use an UrlNavigator in the toolbar insteadFelix Ernst
This commit adds a locationInToolbar KToggleAction to switch between using a location bar to navigate or using a new custom QWidgetAction in the toolbar. A big portion of this MR is refactoring because until now the UrlNavigator was tightly intertwined with the DolphinViewContainer. With this MR an UrlNavigator for controlling a View can be freely connected or disconnected with a single method call. A DolphinUrlNavigator class is created in the process which contains all Dolphin-specific UrlNavigator code which did previously reside in the DolphinViewContainer class. Other application parts that belong to UrlNavigator-management are also moved here.
2020-10-23Compile with QT_NO_KEYWORDSAlexander Lohnau
2020-10-23Compile without foreachAlexander Lohnau
2020-10-23DolphinTabWidget: prefer QUrl::toDisplayString() for tooltipsElvis Angelaccio
This is better for remote urls. !35
2020-10-13Add tooltip to tabbartolu schr
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-05-19DolphinView: rename new methods to copy/move urlsElvis Angelaccio
DolphinView doesn't know anything about split views and it shouldn't. Rename these new methods to what they actually do (just copy or move to a given QUrl).
2020-05-14Allow to copy or move selection to the other split viewAntonio Prcela
Summary: FEATURE: 276167 Default keyboard shortcuts set to `SHIFT+F5` for `copy`, `SHIFT+F6` for `move` Reviewers: #dolphin, elvisangelaccio, ngraham, meven, dfaure Reviewed By: #dolphin, elvisangelaccio, ngraham, meven, dfaure Subscribers: yurchor, kde-doc-english, dfaure, meven, kfm-devel Tags: #dolphin, #documentation Differential Revision: https://phabricator.kde.org/D29006
2020-04-05Dolphin: port to CommandLauncherJobDavid Faure
Summary: git master already requires 5.69 anyway, due to KBookmarkMenu API change Test Plan: Builds, Tools / Compare Files works. Reviewers: broulik, elvisangelaccio, meven Reviewed By: elvisangelaccio, meven Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D28589
2020-03-01Fix typo in commentAlexander Saoutkin
2020-03-01Fix files not being highlighted if directory of file is already openAlexander Saoutkin
Summary: In DolphinTabWidget::openFiles it assumes openDirectories will open new tabs, so it only marks the URL selection for the newly opened tabs. This assumption is incorrect as Dolphin might reuse tabs when the folder is already open. Even then, markUrlsAsSelected does nothing when the folder is already opened. The selection seems to only be used when the folder finishes loading, calls made after that only change a variable without updating the actual selection. A call to DolphinView::updateViewState() is required to restore the intended behaviour, so long as DolphinView::clearSelection() has been called on the relevant tab, otherwise updateViewState() is a no-op. BUG: 417230 FIXED-IN: 19.12.3 Test Plan: 1. In any application that has an "open containing folder" select that option 2. and then do the same for another file in the same folder Reviewers: broulik Reviewed By: broulik Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D27389
2019-10-21Disable keyboard accelerators for the tabs widgetAlex Miranda
Summary: Now that there are actions for switching to a specific tab with default Alt + <number> shortcuts, automatically assigned keyboard accelerators can result in ambiguous shortcuts when using specific tab names containing numbers. Not adding any accelerators for the tabs widget ensures the default shortcuts work reliably regardless of tab names. Test Plan: - Verify there are no ambiguous shortcuts when browsing folders with names containing only numbers - Verify other keyboard accelerators still work (menu bar, context menu and others) Reviewers: #vdg, #dolphin, ngraham Reviewed By: #vdg, ngraham Subscribers: ngraham, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24794
2019-10-13Add actions for switching to a specific tabAlex Miranda
Summary: Add actions to switch to each of the first 9 tabs and another action to switch to the last tab. This feature makes it much easier to quickly switch between tabs just like you normally would be able to when using a web browser or other applications. Reviewers: #vdg, #dolphin, ngraham, elvisangelaccio Reviewed By: #vdg, #dolphin, ngraham Subscribers: meven, ngraham, elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D24353
2019-09-14DolphinTabWidget: cleanup index-by-URL API usageElvis Angelaccio
Summary: Follow-up of D23655 where we didn't have time to polish the code: - add a couple of variables to make the code more clear. - remove the `get` prefix which we usually don't use in Qt code. - make the function private since it's very tied to implementation. - add a new isUrlOpen public method as wrapper. Reviewers: feverfew Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D23860
2019-09-02Merge branch 'Applications/19.08'Elvis Angelaccio
2019-09-02Fixing bugs in new folders in tabs featureAlexander Saoutkin
Summary: Fixing bug where urls in secondary view containers would not be considered for the open new folders in tabs feature. Test Plan: Manual testing. Testing for no regressions. Testing that URL is found if in secondary view container Reviewers: elvisangelaccio Reviewed By: elvisangelaccio Subscribers: kfm-devel, ngraham Tags: #dolphin Differential Revision: https://phabricator.kde.org/D23655