Commit graph

45 commits

Author SHA1 Message Date
Friedrich W. H. Kossebau ed2d352c42 Add explicit moc includes to sources for moc-covered headers
* 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-07-05 07:59:18 +00:00
Felix Ernst e5abe2c67b Update my eMail to the KDE-provided one
GIT_SILENT
NO_CHANGELOG
2023-06-04 18:09:42 +02:00
Eugene Popov 215923b33f Add DolphinTabPage::inactiveViewContainer() 2023-04-23 09:33:09 +00:00
Serg Podtynnyi 38c34eeca3 Add clang-format and format code as in Frameworks 2023-02-05 12:45:38 +07:00
Willyanto Willyanto 0a0f0c76db Replace qswap with std::swap
Fixes obsolete function 'qSwap' called. It is recommended to use 'std::swap'
instead. (CWE-477)
2023-01-16 23:45:56 +07:00
Laurent Montel e19aa49a08 Remove unused includes 2022-09-26 08:17:13 +02:00
Felix Ernst 3b7c05b385 Add Selection Mode
The selection mode action is a checkable toggle action named
"Select Files and Folders" which has "Space" as the default
shortcut.

In selection mode a bottom bar with contextual actions is shown.
These should mostly mirror the actions which are available through
the right-click context menu aka DolphinContextMenu.

Resizing of the window might make a overflow button appear in the
bottom selection mode bar.

This commit makes press and hold in the view activate selection
mode. This behaviour is not triggered if the press and hold is
used to either start a rubberband selection or a drag operation
within a short time. The length of the short timeframe is defined
by a QStyleHint. This is currently not implemented in touch
because I can't test it.

Mix the selection mode bars' background colors using a nice
combination of colors from the current color scheme

BUG: 427202
2022-08-14 14:42:40 +00:00
Eugene Popov b712c9fc46 [Split view] Reset splitter position on double click
This commit makes Dolphin to reset the position of the Split View splitter
on double-click.

BUG: 206525
FIXED-IN: 21.12
2021-08-30 14:18:21 +00:00
Alexander Lohnau 844d1c0547 Remove code for dolphin < 4.14 tab restore
The old config keys haven't been written for since KDE 4 times
and has been internally marked as deprecated.
2021-04-24 17:16:27 +00:00
Felix Ernst 0cee94ce82 Fix location bar being wrongly aligned on first startup
When starting Dolphin the very first time, the spacing in front of the
location bar is wrong. This commit fixes this by completely updating
all cached geometry every time adjustSpacing() is called. Because this
happens once on a timer 100 ms after every url change, it will happen
once shortly after the window is shown. At that point all geometry is
where it should be and spacing calculation works as expected.

The ViewContainer geometry retrieval is refactored into a small nested
helper class in DolphinNavigatorsWidgetAction by the name
ViewGeometriesHelper.

Previously the logic of that class was divided between DolphinTabPage
and DolphinNavigatorsWidgetAction.

BUG: 429447
FIXED-IN: 21.04.0
2021-01-06 01:38:45 +00:00
Felix Ernst f01a61b76c Animate split view mode toggling
Have the secondary ViewContainer slide into/out of view when split view mode is switched on or off by the user.

This should help users understand what split view mode is about. Without the animation it might seem like the only thing the button does is creating a weird vertical line in the middle of the view or something. With the animation it should be clear that the second view is a separate entity that was added. The closing animation will help users understand which of the ViewContainers was just closed.
2021-01-02 17:48:52 +00:00
Felix Ernst 50ca5af7e0 Allow having the UrlNavigators below the tab bar
This commit restores the possibility to have the UrlNavigators below
the tab bar. This will happen automatically whenever the UrlNavigator
is removed from the toolbar.

It is also now again possible to have the toolbar on the side. This
option is disabled while the toolbar contains the UrlNavigators.

This commit makes no changes to the new default which is having the
UrlNavigators in the toolbar but makes sure that upgrading users won't
be affected.
2020-11-19 21:22:27 +00:00
Felix Ernst 63f4981fe0 Adress the third round of Angelaccio's review comments
Additionally remove some redundant code concerning UrlNavigator visuals.
2020-11-09 23:49:07 +01:00
Felix Ernst a418d6229e Fix a crash and extract unrelated changes
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-09 23:49:07 +01:00
Felix Ernst 37327c9b0a Make UrlNavigators in the toolbar the only option
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-09 23:49:07 +01:00
Felix Ernst 6151a7aec0 Add the UrlNavigator to the toolbar automatically if needed
This commit adds the DolphinUrlNavigatorWidgetAction::addToToolbarAndSave()
method which changes the users toolbar configuration to contain an
Url Navigator. This way the user doesn't need to do anything manually.

Aside from that a bunch of minor fixes like renaming and reordering
2020-11-09 23:49:07 +01:00
Felix Ernst ad5d3367c7 Add an option to use an UrlNavigator in the toolbar instead
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-11-09 23:49:07 +01:00
Alexander Lohnau 97415729c3 Compile with QT_NO_KEYWORDS 2020-10-23 18:23:06 +00:00
Elvis Angelaccio 954e8c4790 Output of licensedigger + manual cleanup afterwards.
Unfortunately licensedigger does not strip the trailing * characters.
While at it, use a common style for all source files.
2020-08-25 17:07:38 +00:00
Elvis Angelaccio 16a3aea6a6 Remove unnecessary semicolons after Q_UNUSED
GIT_SILENT
2019-11-09 22:09:16 +01:00
Laurent Montel 4315e5c938 remove deprecated methods 2019-02-27 08:59:18 +01:00
Angelo Oliveira Jr 92368c1e4d Add option to choose which view to close
Summary:
This Diff make configurable which view will close when toggling off
the split view mode, if it's the active one or the inactive one.

A new checkbox was added to the Dolphin configuration window,
and defaults to the original behavior.

FEATURE: 312834
FIXED-IN: 19.03.80

Test Plan: {F6535432}

Reviewers: ngraham, #dolphin, elvisangelaccio

Reviewed By: ngraham, #dolphin

Subscribers: elvisangelaccio, cfeck, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D18040
2019-02-16 16:09:27 +01:00
Chris Rizzitello 784734ca16 Abort updateWindowTitle and activeViewChanged if not changed.
Summary:
 - Prevent activeViewChanged from updating the window if the view is the same view (happens at least once when starting up)
 - Stop updateWindowTitle from updating the title if its not changed.

Reviewers: #dolphin, elvisangelaccio, broulik

Reviewed By: #dolphin, elvisangelaccio, broulik

Subscribers: anthonyfieroni, broulik, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D17882
2019-01-16 17:34:26 -05:00
Elvis Angelaccio 504db3f702 Fix title update when changing active split view
Summary:
The DolphinTabPage::activeViewUrlChanged signal triggers the title
update in DolphinMainWindow, which sets the new title from the
`m_activeViewContainer` instance.

This means we need to notify the main window that the active view
changed before telling it that the current url changed.

BUG: 402641
FIXED-IN: 18.12.1

Reviewers: #dolphin, rizzitello, ngraham

Reviewed By: #dolphin, rizzitello, ngraham

Subscribers: rizzitello, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D17881
2019-01-05 17:29:34 +01:00
Elvis Angelaccio 362244ccbe DolphinTabPage: deactivate secondary view after closing split view
We deactivate the previously active view container whenever we change the active
split view, but we never do the same when we close the split view.

Long term we should probably even delete the secondary view after
closing the split view, because it will never be used again and the
pointer will be overwritten the next time the user opens the split view.
2018-04-25 13:42:18 +02:00
Robert Jennings 78c8b36dd8 Update window title after closing split view
Summary:

In dolphintabpage.cpp:

Through the connections set up in createViewContainer(), m_primaryViewContainer->setActive(true), at line 98,
ends up triggering slotViewActivated().

Because m_primaryViewActive is true, oldActiveView is not set to the view needed in this particular situation.
Both oldActiveView and newActiveView end up pointing to the same view and the connections are not set up.

BUG: 385111
FIXED-IN: 18.04.1

Test Plan:
1. Open split view
2. Make left panel active
3. Close split view
4. Navigate to various directories

Window title now updates to show current directory

Also tried with multiple tabs/combinations

Reviewers: #dolphin, ngraham

Reviewed By: #dolphin, ngraham

Subscribers: elvisangelaccio, ngraham

Differential Revision: https://phabricator.kde.org/D12446
2018-04-25 12:37:28 +02:00
Roman Inflianskas 48b58f830a Remove unused #include
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-04 21:00:47 +03:00
Anthony Fieroni 43da84eefc Correct searchbox, split view transitions between tabs
Differential Revision: https://phabricator.kde.org/D5864

BUG: 379135
BUG: 380032
FIXED-IN: 17.04.2

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2017-05-22 20:35:29 +03:00
arnav dhamija d5e692d16d fixed arg 2017-02-13 17:08:10 +05:30
arnav dhamija e8a4868943 Made more changes 2017-01-29 23:31:43 +05:30
arnav dhamija e7f6a1010a Changed default arg for the setSplitViewEnabled 2016-11-02 21:49:11 +05:30
arnav dhamija a097a1277a Changed shortcut, but need to fix async conditions 2016-09-27 10:37:08 +05:30
arnav dhamija 2704b3693f Added the GUI button for quick stashing 2016-09-26 22:25:42 +05:30
Martin T. H. Sandsmark b706108206 Use tab for switching active split
REVIEW: 128564
REVIEW: 110970
BUGS: 171743
2016-09-04 14:12:53 +02:00
Artur Puzio 5593c252e8 [CLAZY] Fixed all level 1 and level 2 warnings with small exceptions
REVIEW: 126771
2016-03-16 22:17:37 +01:00
Lukáš Tinkl 1b4572dac9 port Dolphin from KUrl to QUrl
REVIEW: 120688
2014-10-21 21:19:14 +02:00
Lukáš Tinkl d9d7926c49 port Konqueror from KUrl to QUrl
REVIEW: 120650
2014-10-21 00:28:58 +02:00
Montel Laurent 0a6257bce3 Fix includes 2014-10-18 15:00:17 +02:00
Emmanuel Pescosta 2d2d55f3df Save the view states in addition to the view urls and splitter state in DolphinTabPage.
Also added version numbers to view and tab state.

REVIEW: 119792
2014-08-20 23:06:39 +02:00
Emmanuel Pescosta 39d8fb12c1 React on the redirection signal from DolphinView to properly update the tab and window titles.
REVIEW: 119697
BUG: 305721
2014-08-13 22:06:28 +02:00
Frank Reininghaus 4b70446c17 Merge branch 'KDE/4.14' 2014-08-12 09:23:24 +02:00
Frank Reininghaus 4ed068ffff Fix crash when restoring a session stored with Dolphin 4.13 or earlier
Since DolphinTabPage::saveState() and
DolphinTabPage::restoreState(const QByteArray& state) save and restore
the state of each tab in a different format than DolphinMainWindow did
before the refactoring, we can run into problems: the first time a user
logs into a session that has Dolphin 4.14, Dolphin might read session
data that does not contain the QByteArray that DolphinTabPage wants to
read the data from.

In restoreState, isSplitViewEnabled will thus have the value false, and
no secondary view will be created. Later on, m_primaryViewActive will
also be set to false, but the else branch of the following
"if (m_primaryViewActive)" then tries to activate the secondary view,
which does not exist -> we get a crash.

The easiest solution is to not restore the tab state if no session data
in the new format is found.

BUG: 338187
REVIEW: 119718
FIXED-IN: 4.14.0
2014-08-12 09:08:30 +02:00
Emmanuel Pescosta 38381bc6a2 Implemented DolphinTabWidget class to encapsulate the tab handling from DolphinMainWindow.
REVIEW: 119115
2014-08-10 18:52:06 +02:00
Frank Reininghaus 7cb193de10 Fix regression concerning the "Places" selector in the location bar
This commit ensures that the selector is visible in all location bars
if and only if the Places Panel is hidden. It fixes a regression caused
by commit 6a98d83312.

BUG: 337389
FIXED-IN: 4.14.0
REVIEW: 119238
2014-07-16 09:12:16 +02:00
Emmanuel Pescosta b0fb590ebd Implemented DolphinTabPage class to encapsulate the split view handling from DolphinMainWindow.
The signal activeViewUrlChanged in DolphinTabPage is currently unused, but we need it later when
we implement the tab widget and tab bar.

DolphinTabPage has saveState/restoreState which are using a QByteArray instead of the KConfigGroup to
be more generic.

REVIEW: 118964
2014-07-04 17:16:03 +02:00