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
{
connect(container, &DolphinViewContainer::showFilterBarChanged, this, &DolphinMainWindow::updateFilterBarAction);
connect(container, &DolphinViewContainer::writeStateChanged, this, &DolphinMainWindow::slotWriteStateChanged);
{
connect(container, &DolphinViewContainer::showFilterBarChanged, this, &DolphinMainWindow::updateFilterBarAction);
connect(container, &DolphinViewContainer::writeStateChanged, this, &DolphinMainWindow::slotWriteStateChanged);
+ slotWriteStateChanged(container->view()->isFolderWritable());
connect(container, &DolphinViewContainer::searchModeEnabledChanged, this, &DolphinMainWindow::updateSearchAction);
connect(container, &DolphinViewContainer::captionChanged, this, &DolphinMainWindow::updateWindowTitle);
connect(container, &DolphinViewContainer::tabRequested, this, &DolphinMainWindow::openNewTab);
connect(container, &DolphinViewContainer::searchModeEnabledChanged, this, &DolphinMainWindow::updateSearchAction);
connect(container, &DolphinViewContainer::captionChanged, this, &DolphinMainWindow::updateWindowTitle);
connect(container, &DolphinViewContainer::tabRequested, this, &DolphinMainWindow::openNewTab);
if (text.isEmpty()) {
// Restore URL when search box is cleared by closing and reopening the box.
emitCloseRequest();
if (text.isEmpty()) {
// Restore URL when search box is cleared by closing and reopening the box.
emitCloseRequest();
- QTimer::singleShot(0, this, [this] {
- Q_EMIT openRequest();
- });
} else {
m_startSearchTimer->start();
}
} else {
m_startSearchTimer->start();
}
if (active) {
m_container->setFocus();
Q_EMIT activated();
if (active) {
m_container->setFocus();
Q_EMIT activated();
- Q_EMIT writeStateChanged(m_isFolderWritable);
+bool DolphinView::isFolderWritable() const
+{
+ return m_isFolderWritable;
+}
+
QUrl DolphinView::viewPropertiesUrl() const
{
if (m_viewPropertiesContext.isEmpty()) {
QUrl DolphinView::viewPropertiesUrl() const
{
if (m_viewPropertiesContext.isEmpty()) {
/** Activates the view if the item list container gets focus. */
bool eventFilter(QObject *watched, QEvent *event) override;
/** 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();
public Q_SLOTS:
void reload();
/**
* Updates m_isFolderWritable dependent on whether the folder represented by
* the current URL is writable. If the state has changed, the signal
/**
* 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();
*/
void updateWritableState();
connect(view, &DolphinView::sortRoleChanged, this, &DolphinViewActionHandler::slotSortRoleChanged);
connect(view, &DolphinView::zoomLevelChanged, this, &DolphinViewActionHandler::slotZoomLevelChanged);
connect(view, &DolphinView::writeStateChanged, this, &DolphinViewActionHandler::slotWriteStateChanged);
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);
});
connect(view, &DolphinView::selectionModeChangeRequested, this, [this](bool enabled) {
Q_EMIT selectionModeChangeTriggered(enabled);
});