diff options
| author | Norbert Preining <[email protected]> | 2021-01-19 06:43:14 +0900 |
|---|---|---|
| committer | Norbert Preining <[email protected]> | 2021-01-19 07:48:36 +0900 |
| commit | 33270dd4423eea329b8f20db17f8d70ab7b108da (patch) | |
| tree | e6950c3726038cf17c1bd603a96560ec8d2a0fbe /src/dolphinnavigatorswidgetaction.h | |
| parent | a6d095fa0450237f89e240da99877f6c79b46ecc (diff) | |
Show button to open knetattach inline with URL nav on remove:// view
This is a backport of b1cadeba939155282a9fadf7d7b025d6529c489e
From b1cadeba939155282a9fadf7d7b025d6529c489e Mon Sep 17 00:00:00 2001
From: Nate Graham <[email protected]>
Date: Tue, 15 Dec 2020 23:03:00 -0700
Subject: [PATCH] Show button to open knetattach inline with URL nav on
Remote:// view
In conjunction with
https://invent.kde.org/frameworks/kio/-/merge_requests/260,
the net result is to hide the knetattach launcher in the view, and show
it inline with Dolphin's URL navigator toolbar when viewing the
remote:// view, just like how we add an "Empty Trash" button when
viewing trash://.
The backport ensures that even with frameworks << 5.78 only one network
button is shown.
BUG: 431626
Diffstat (limited to 'src/dolphinnavigatorswidgetaction.h')
| -rw-r--r-- | src/dolphinnavigatorswidgetaction.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/dolphinnavigatorswidgetaction.h b/src/dolphinnavigatorswidgetaction.h index bbd8cf127..ce199b3f0 100644 --- a/src/dolphinnavigatorswidgetaction.h +++ b/src/dolphinnavigatorswidgetaction.h @@ -10,6 +10,7 @@ #include "dolphinurlnavigator.h" +#include <kio_version.h> #include <QSplitter> #include <QTimer> #include <QWidgetAction> @@ -30,7 +31,8 @@ class QPushButton; * The secondary side only exists for split view and is created by * createSecondaryUrlNavigator() when necessary. * - Each side is a QWidget which I call NavigatorWidget with a QHBoxLayout. - * - Each NavigatorWidget consists an UrlNavigator, an emptyTrashButton and spacing. + * - Each NavigatorWidget consists an UrlNavigator, an emptyTrashButton, a + * networkFolderButton (for frameworks >= 5.78), and spacing. * - Only the primary navigatorWidget has leading spacing. Both have trailing spacing. * The spacing is there to align the UrlNavigator with its DolphinViewContainer. */ @@ -131,6 +133,22 @@ private: */ QPushButton *newEmptyTrashButton(const DolphinUrlNavigator *urlNavigator, QWidget *parent) const; +#if !(KIO_VERSION < QT_VERSION_CHECK(5, 78, 0)) + /** + * Used to retrieve the networkFolderButtons for the navigatorWidgets on + * both sides. + */ + QPushButton *networkFolderButton(Side side); + + /** + * Creates a new add "network folder" button. + * @param urlNavigator Only when this UrlNavigator shows the remote directory + * will the button be visible. + * @param parent The object that should be the button's parent. + */ + QPushButton *newNetworkFolderButton(const DolphinUrlNavigator *urlNavigator, QWidget *parent) const; +#endif + enum Position { Leading, Trailing |
