#include <KUrlNavigator>
#include <KWindowSystem>
#include <KXMLGUIFactory>
+#include <kxmlgui_version.h>
#include <kio_version.h>
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<bool>::of(&KIO::FileUndoManager::undoAvailable),
+ connect(undoManager, &KIO::FileUndoManager::undoAvailable,
this, &DolphinMainWindow::slotUndoAvailable);
connect(undoManager, &KIO::FileUndoManager::undoTextChanged,
this, &DolphinMainWindow::slotUndoTextChanged);
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);
connect(&m_fileItemActions, &KFileItemActions::error, this, [this](const QString &errorMessage) {
showErrorMessage(errorMessage);
});
+
+ connect(GeneralSettings::self(), &GeneralSettings::splitViewChanged,
+ this, &DolphinMainWindow::slotSplitViewChanged);
}
DolphinMainWindow::~DolphinMainWindow()
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();
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
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 "
"<emphasis>Filter Bar</emphasis> at the bottom of the window.<nl/> "
"There you can enter a text to filter the files and folders currently displayed. "
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();
}
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);