X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/27bfcde4efaf936243fc41e4a61d0cac32105ef6..fd717b88faab656205c2b5712959f9fd48e433a5:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index f3a5e3b4e..4b7aba224 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -64,6 +64,7 @@ #include #include #include +#include #include @@ -122,13 +123,17 @@ DolphinMainWindow::DolphinMainWindow() : setComponentName(QStringLiteral("dolphin"), QGuiApplication::applicationDisplayName()); setObjectName(QStringLiteral("Dolphin#")); +#if KXMLGUI_VERSION >= QT_VERSION_CHECK(5, 88, 0) + setStateConfigGroup("State"); +#endif + connect(&DolphinNewFileMenuObserver::instance(), &DolphinNewFileMenuObserver::errorMessage, this, &DolphinMainWindow::showErrorMessage); KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self(); undoManager->setUiInterface(new UndoUiInterface()); - connect(undoManager, QOverload::of(&KIO::FileUndoManager::undoAvailable), + connect(undoManager, &KIO::FileUndoManager::undoAvailable, this, &DolphinMainWindow::slotUndoAvailable); connect(undoManager, &KIO::FileUndoManager::undoTextChanged, this, &DolphinMainWindow::slotUndoTextChanged); @@ -206,7 +211,7 @@ DolphinMainWindow::DolphinMainWindow() : setupWhatsThis(); - connect(KSycoca::self(), QOverload<>::of(&KSycoca::databaseChanged), this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); + connect(KSycoca::self(), &KSycoca::databaseChanged, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); QTimer::singleShot(0, this, &DolphinMainWindow::updateOpenPreferredSearchToolAction); @@ -214,6 +219,9 @@ DolphinMainWindow::DolphinMainWindow() : connect(&m_fileItemActions, &KFileItemActions::error, this, [this](const QString &errorMessage) { showErrorMessage(errorMessage); }); + + connect(GeneralSettings::self(), &GeneralSettings::splitViewChanged, + this, &DolphinMainWindow::slotSplitViewChanged); } DolphinMainWindow::~DolphinMainWindow() @@ -437,6 +445,12 @@ void DolphinMainWindow::openNewTab(const QUrl& url) m_tabWidget->openNewTab(url, QUrl()); } +void DolphinMainWindow::slotSplitViewChanged() +{ + m_tabWidget->currentTabPage()->setSplitViewEnabled(GeneralSettings::splitView(), WithAnimation); + updateSplitAction(); +} + void DolphinMainWindow::openInNewTab() { const KFileItemList& list = m_activeViewContainer->view()->selectedItems(); @@ -1011,7 +1025,11 @@ void DolphinMainWindow::updateOpenPreferredSearchToolAction() if (tool) { openPreferredSearchTool->setVisible(true); openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open %1", tool->text())); - openPreferredSearchTool->setIcon(tool->icon()); + // Only override with the app icon if it is the default, i.e. the user hasn't configured one manually + // https://bugs.kde.org/show_bug.cgi?id=442815 + if (openPreferredSearchTool->icon().name() == QLatin1String("search")) { + openPreferredSearchTool->setIcon(tool->icon()); + } } else { openPreferredSearchTool->setVisible(false); // still visible in Shortcuts configuration window @@ -1462,7 +1480,7 @@ void DolphinMainWindow::setupActions() QAction* showFilterBar = actionCollection()->addAction(QStringLiteral("show_filter_bar")); showFilterBar->setText(i18nc("@action:inmenu Tools", "Filter...")); - showFilterBar->setToolTip(i18nc("@info:tooltip", "Toggle Filter Bar")); + showFilterBar->setToolTip(i18nc("@info:tooltip", "Show Filter Bar")); showFilterBar->setWhatsThis(xi18nc("@info:whatsthis", "This opens the " "Filter Bar at the bottom of the window. " "There you can enter a text to filter the files and folders currently displayed. " @@ -2097,11 +2115,6 @@ void DolphinMainWindow::refreshViews() m_tabWidget->refreshViews(); if (GeneralSettings::modifiedStartupSettings()) { - // The startup settings have been changed by the user (see bug #254947). - // Synchronize the split-view setting with the active view: - const bool splitView = GeneralSettings::splitView(); - m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView, WithAnimation); - updateSplitAction(); updateWindowTitle(); } @@ -2121,6 +2134,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container) this, &DolphinMainWindow::slotWriteStateChanged); connect(container, &DolphinViewContainer::searchModeEnabledChanged, this, &DolphinMainWindow::updateSearchAction); + connect(container, &DolphinViewContainer::captionChanged, + this, &DolphinMainWindow::updateWindowTitle); const QAction* toggleSearchAction = actionCollection()->action(QStringLiteral("toggle_search")); connect(toggleSearchAction, &QAction::triggered, container, &DolphinViewContainer::setSearchModeEnabled);