diff options
| author | Amol Godbole <[email protected]> | 2023-10-10 22:39:03 -0500 |
|---|---|---|
| committer | Felix Ernst <[email protected]> | 2023-10-12 09:43:37 +0000 |
| commit | 2f39eb51b6d92172905a4c39f3c1bcd8053f593b (patch) | |
| tree | 87555dd69e0a40e617f7106636df8aab694c14d4 /src/views | |
| parent | 9e6891deaa6265ad8b5575948d5b342588066296 (diff) | |
DolphinView: get rid of writeStateChanged signal in setActive()
The signal writeStateChanged() was not working because it is not connected
to slotWriteStateChanged() slots when the active view changes. Replace the
signal with direct calls to the slots.
Also, do not delay openRequest signal in DolphinSearchBox::slotSearchTextChanged.
It's no longer required.
BUG: 440366
Diffstat (limited to 'src/views')
| -rw-r--r-- | src/views/dolphinview.cpp | 6 | ||||
| -rw-r--r-- | src/views/dolphinview.h | 7 | ||||
| -rw-r--r-- | src/views/dolphinviewactionhandler.cpp | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index d8eab142d..ace763b15 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -270,7 +270,6 @@ void DolphinView::setActive(bool active) if (active) { m_container->setFocus(); Q_EMIT activated(); - Q_EMIT writeStateChanged(m_isFolderWritable); } } @@ -2246,6 +2245,11 @@ void DolphinView::updateWritableState() } } +bool DolphinView::isFolderWritable() const +{ + return m_isFolderWritable; +} + QUrl DolphinView::viewPropertiesUrl() const { if (m_viewPropertiesContext.isEmpty()) { diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 05b9e009c..0b0c83487 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -344,6 +344,11 @@ public: /** Activates the view if the item list container gets focus. */ bool eventFilter(QObject *watched, QEvent *event) override; + /** + * Returns whether the folder represented by the current URL is writable. + */ + bool isFolderWritable() const; + public Q_SLOTS: void reload(); @@ -880,7 +885,7 @@ private: /** * Updates m_isFolderWritable dependent on whether the folder represented by * the current URL is writable. If the state has changed, the signal - * writeableStateChanged() will be emitted. + * writeStateChanged() will be emitted. */ void updateWritableState(); diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 7117e9e1b..f73c613e0 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -60,6 +60,7 @@ void DolphinViewActionHandler::setCurrentView(DolphinView *view) connect(view, &DolphinView::sortRoleChanged, this, &DolphinViewActionHandler::slotSortRoleChanged); connect(view, &DolphinView::zoomLevelChanged, this, &DolphinViewActionHandler::slotZoomLevelChanged); connect(view, &DolphinView::writeStateChanged, this, &DolphinViewActionHandler::slotWriteStateChanged); + slotWriteStateChanged(view->isFolderWritable()); connect(view, &DolphinView::selectionModeChangeRequested, this, [this](bool enabled) { Q_EMIT selectionModeChangeTriggered(enabled); }); |
