From a5c36c615a9388301330c9a32898d4f4b57eede7 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Sun, 26 Apr 2026 13:05:57 +0200 Subject: Remove code for notifying about successful job completion Because of a bug these messages haven't reached users in years, and it seems it is better this way. Remove the dead code. Preparation for https://invent.kde.org/system/dolphin/-/merge_requests/1254 --- src/dolphinmainwindow.cpp | 47 -------------------------------------------- src/dolphinmainwindow.h | 14 +++---------- src/dolphinviewcontainer.cpp | 11 +---------- src/dolphinviewcontainer.h | 3 --- 4 files changed, 4 insertions(+), 71 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 615e52480..dd511ccd9 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -33,7 +33,6 @@ #endif #include "settings/dolphinsettingsdialog.h" #include "statusbar/diskspaceusagemenu.h" -#include "statusbar/dolphinstatusbar.h" #include "views/dolphinnewfilemenuobserver.h" #include "views/dolphinremoteencoding.h" #include "views/dolphinviewactionhandler.h" @@ -164,8 +163,6 @@ DolphinMainWindow::DolphinMainWindow() connect(undoManager, &KIO::FileUndoManager::redoAvailable, this, &DolphinMainWindow::slotRedoAvailable); connect(undoManager, &KIO::FileUndoManager::redoTextChanged, this, &DolphinMainWindow::slotRedoTextChanged); #endif - connect(undoManager, &KIO::FileUndoManager::jobRecordingStarted, this, &DolphinMainWindow::clearStatusBar); - connect(undoManager, &KIO::FileUndoManager::jobRecordingFinished, this, &DolphinMainWindow::showCommand); const bool firstRun = (GeneralSettings::version() < 200); if (firstRun) { @@ -187,7 +184,6 @@ DolphinMainWindow::DolphinMainWindow() setupActions(); m_actionHandler = new DolphinViewActionHandler(actionCollection(), m_actionTextHelper, this); - connect(m_actionHandler, &DolphinViewActionHandler::actionBeingHandled, this, &DolphinMainWindow::clearStatusBar); connect(m_actionHandler, &DolphinViewActionHandler::createDirectoryTriggered, this, &DolphinMainWindow::createDirectory); connect(m_actionHandler, &DolphinViewActionHandler::createFileTriggered, this, &DolphinMainWindow::createFile); connect(m_actionHandler, &DolphinViewActionHandler::selectionModeChangeTriggered, this, &DolphinMainWindow::slotSetSelectionMode); @@ -359,35 +355,6 @@ bool DolphinMainWindow::isActiveWindow() return window()->isActiveWindow(); } -void DolphinMainWindow::showCommand(CommandType command) -{ - DolphinStatusBar *statusBar = m_activeViewContainer->statusBar(); - switch (command) { - case KIO::FileUndoManager::Copy: - statusBar->setText(i18nc("@info:status", "Successfully copied.")); - break; - case KIO::FileUndoManager::Move: - statusBar->setText(i18nc("@info:status", "Successfully moved.")); - break; - case KIO::FileUndoManager::Link: - statusBar->setText(i18nc("@info:status", "Successfully linked.")); - break; - case KIO::FileUndoManager::Trash: - statusBar->setText(i18nc("@info:status", "Successfully moved to trash.")); - break; - case KIO::FileUndoManager::Rename: - statusBar->setText(i18nc("@info:status", "Successfully renamed.")); - break; - - case KIO::FileUndoManager::Mkdir: - statusBar->setText(i18nc("@info:status", "Created folder.")); - break; - - default: - break; - } -} - void DolphinMainWindow::pasteIntoFolder() { m_activeViewContainer->view()->pasteIntoFolder(); @@ -892,7 +859,6 @@ void DolphinMainWindow::slotUndoTextChanged(const QString &text) void DolphinMainWindow::undo() { - clearStatusBar(); KIO::FileUndoManager::self()->uiInterface()->setParentWidget(this); KIO::FileUndoManager::self()->undo(); } @@ -916,7 +882,6 @@ void DolphinMainWindow::slotRedoTextChanged(const QString &text) void DolphinMainWindow::redo() { - clearStatusBar(); KIO::FileUndoManager::self()->uiInterface()->setParentWidget(this); KIO::FileUndoManager::self()->redo(); } @@ -1082,8 +1047,6 @@ void DolphinMainWindow::slotSetSelectionMode(bool enabled, SelectionMode::Bottom void DolphinMainWindow::selectAll() { - clearStatusBar(); - // if the URL navigator is editable and focused, select the whole // URL instead of all items of the view @@ -1099,7 +1062,6 @@ void DolphinMainWindow::selectAll() void DolphinMainWindow::invertSelection() { - clearStatusBar(); m_activeViewContainer->view()->invertSelection(); } @@ -1171,9 +1133,7 @@ void DolphinMainWindow::moveToInactiveSplitView() void DolphinMainWindow::reloadView() { - clearStatusBar(); m_activeViewContainer->reload(); - m_activeViewContainer->statusBar()->updateSpaceInfo(); Q_EMIT urlRefreshed(m_activeViewContainer->url()); } @@ -1216,8 +1176,6 @@ void DolphinMainWindow::toggleFilterBar() void DolphinMainWindow::toggleEditLocation() { - clearStatusBar(); - QAction *action = actionCollection()->action(QStringLiteral("editable_location")); KUrlNavigator *urlNavigator = m_activeViewContainer->urlNavigator(); urlNavigator->setUrlEditable(action->isChecked()); @@ -2799,11 +2757,6 @@ void DolphinMainWindow::refreshViews() Q_EMIT settingsChanged(); } -void DolphinMainWindow::clearStatusBar() -{ - m_activeViewContainer->statusBar()->resetToDefaultText(); -} - void DolphinMainWindow::connectViewSignals(DolphinViewContainer *container) { connect(container, &DolphinViewContainer::showFilterBarChanged, this, &DolphinMainWindow::updateFilterBarAction); diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 9c41f73fe..4b2b0c87b 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -301,15 +301,13 @@ private Q_SLOTS: */ void refreshViews(); - void clearStatusBar(); - /** Updates the 'Create New...' sub menu. */ void updateNewMenu(); void createDirectory(); void createFile(); - /** Shows the error message in the status bar of the active view. */ + /** Shows the error message in a non-modal message box above the active view. */ void showErrorMessage(const QString &message); /** @@ -555,12 +553,6 @@ private Q_SLOTS: */ void showTarget(); - /** - * Indicates in the statusbar that the execution of the command \a command - * has been finished. - */ - void showCommand(CommandType command); - /** * If the URL can be listed, open it in the current view, otherwise * run it through KRun. @@ -770,8 +762,8 @@ private: private: /** * Implements a custom error handling for the undo manager. This - * assures that all errors are shown in the status bar of Dolphin - * instead as modal error dialog with an OK button. + * assures that all errors are shown as a message box above the view, + * and not as modal error dialogs with an OK button. */ class UndoUiInterface : public KIO::FileUndoManager::UiInterface { diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 56c659b76..3db6ca553 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -246,16 +246,6 @@ void DolphinViewContainer::setGrabFocusOnUrlChange(bool grabFocus) m_grabFocusOnUrlChange = grabFocus; } -const DolphinStatusBar *DolphinViewContainer::statusBar() const -{ - return m_statusBar; -} - -DolphinStatusBar *DolphinViewContainer::statusBar() -{ - return m_statusBar; -} - const DolphinUrlNavigator *DolphinViewContainer::urlNavigator() const { return m_urlNavigatorConnected; @@ -573,6 +563,7 @@ void DolphinViewContainer::reload() { view()->reload(); m_messageWidget->hide(); + m_statusBar->updateSpaceInfo(); } QString DolphinViewContainer::captionWindowTitle() const diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index f7ec01885..9c6dbb611 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -88,9 +88,6 @@ public: */ void setGrabFocusOnUrlChange(bool grabFocus); - const DolphinStatusBar *statusBar() const; - DolphinStatusBar *statusBar(); - /** * @return An UrlNavigator that is controlling this view * or nullptr if there is none. -- cgit v1.3