┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorNicolas Fella <[email protected]>2023-10-24 23:12:22 +0200
committerNicolas Fella <[email protected]>2023-10-24 23:14:25 +0200
commit1826f905d706925456763394de17294bcb6d1c35 (patch)
tree6838f9f0a8423cc7b0b86554139299c649f53b42 /src/views
parent8b91acf05b2b41ae68268081d31af18cf66d3bca (diff)
parentef59e42c40df5e873a1a1b6c2173d5b55641a783 (diff)
Merge branch 'master' into kf6
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp8
-rw-r--r--src/views/dolphinview.h7
-rw-r--r--src/views/dolphinviewactionhandler.cpp1
3 files changed, 13 insertions, 3 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 5bdc9e15f..0bb73e623 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -267,7 +267,6 @@ void DolphinView::setActive(bool active)
if (active) {
m_container->setFocus();
Q_EMIT activated();
- Q_EMIT writeStateChanged(m_isFolderWritable);
}
}
@@ -1759,7 +1758,7 @@ void DolphinView::updateViewState()
// scroll to current item and reset the state
if (m_scrollToCurrentItem) {
- m_view->scrollToItem(currentIndex);
+ m_view->scrollToItem(currentIndex, KItemListView::ViewItemPosition::Middle);
m_scrollToCurrentItem = false;
}
m_currentItemUrl = QUrl();
@@ -2243,6 +2242,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 397ff5d5e..98cbbdf80 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);
});