diff options
| author | Eugene Popov <[email protected]> | 2021-12-02 09:03:47 +0000 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2021-12-02 09:03:47 +0000 |
| commit | 2ef87708fdc0ff9d0337482b994bd6efa6b9b623 (patch) | |
| tree | bb243133607669bfad54d10f0beb0e2fdf805029 /src | |
| parent | f1756dd1413fa602f536e057087583be2ddbd2b2 (diff) | |
[Location Bar] Add the ability to show hidden folders in the subdirectories popup
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 20 | ||||
| -rw-r--r-- | src/dolphinviewcontainer.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 135491633..4ec855226 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -151,6 +151,10 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) : this, &DolphinViewContainer::slotUrlIsFileError); connect(m_view, &DolphinView::activated, this, &DolphinViewContainer::activate); + connect(m_view, &DolphinView::hiddenFilesShownChanged, + this, &DolphinViewContainer::slotHiddenFilesShownChanged); + connect(m_view, &DolphinView::sortHiddenLastChanged, + this, &DolphinViewContainer::slotSortHiddenLastChanged); // Initialize status bar m_statusBar = new DolphinStatusBar(this); @@ -309,6 +313,8 @@ void DolphinViewContainer::connectUrlNavigator(DolphinUrlNavigator *urlNavigator Q_CHECK_PTR(m_view); urlNavigator->setLocationUrl(m_view->url()); + urlNavigator->setShowHiddenFolders(m_view->hiddenFilesShown()); + urlNavigator->setSortHiddenFoldersLast(m_view->sortHiddenLast()); if (m_urlNavigatorVisualState) { urlNavigator->setVisualState(*m_urlNavigatorVisualState.get()); m_urlNavigatorVisualState.reset(); @@ -809,6 +815,20 @@ void DolphinViewContainer::slotPlacesModelChanged() } } +void DolphinViewContainer::slotHiddenFilesShownChanged(bool showHiddenFiles) +{ + if (m_urlNavigatorConnected) { + m_urlNavigatorConnected->setShowHiddenFolders(showHiddenFiles); + } +} + +void DolphinViewContainer::slotSortHiddenLastChanged(bool hiddenLast) +{ + if (m_urlNavigatorConnected) { + m_urlNavigatorConnected->setSortHiddenFoldersLast(hiddenLast); + } +} + bool DolphinViewContainer::isSearchUrl(const QUrl& url) const { return url.scheme().contains(QLatin1String("search")); diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index 304c9958d..be899ba23 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -361,6 +361,9 @@ private Q_SLOTS: */ void slotPlacesModelChanged(); + void slotHiddenFilesShownChanged(bool showHiddenFiles); + void slotSortHiddenLastChanged(bool hiddenLast); + private: /** * @return True if the URL protocol is a search URL (e. g. baloosearch:// or filenamesearch://). |
