- DolphinView* view = container->view();
- connect(view, SIGNAL(selectionChanged(KFileItemList)),
- this, SLOT(slotSelectionChanged(KFileItemList)));
- connect(view, SIGNAL(requestItemInfo(KFileItem)),
- this, SLOT(slotRequestItemInfo(KFileItem)));
- connect(view, SIGNAL(activated()),
- this, SLOT(toggleActiveView()));
- connect(view, SIGNAL(doingOperation(KonqFileUndoManager::CommandType)),
- this, SLOT(slotDoingOperation(KonqFileUndoManager::CommandType)));
+ delete m_updateToolBarTimer;
+ m_updateToolBarTimer = nullptr;
+}
+
+bool DolphinMainWindow::addActionToMenu(QAction* action, QMenu* menu)
+{
+ Q_ASSERT(action);
+ Q_ASSERT(menu);
+
+ const KToolBar* toolBarWidget = toolBar();
+ foreach (const QWidget* widget, action->associatedWidgets()) {
+ if (widget == toolBarWidget) {
+ return false;
+ }
+ }
+
+ menu->addAction(action);
+ return true;
+}
+
+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);
+ updateSplitAction();
+ setUrlAsCaption(activeViewContainer()->url());
+ }
+
+ emit settingsChanged();
+}
+
+void DolphinMainWindow::clearStatusBar()
+{
+ m_activeViewContainer->statusBar()->resetToDefaultText();
+}
+
+void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
+{
+ connect(container, &DolphinViewContainer::showFilterBarChanged,
+ this, &DolphinMainWindow::updateFilterBarAction);
+ connect(container, &DolphinViewContainer::writeStateChanged,
+ this, &DolphinMainWindow::slotWriteStateChanged);
+
+ const DolphinView* view = container->view();
+ connect(view, &DolphinView::selectionChanged,
+ this, &DolphinMainWindow::slotSelectionChanged);
+ connect(view, &DolphinView::requestItemInfo,
+ this, &DolphinMainWindow::requestItemInfo);
+ connect(view, &DolphinView::tabRequested,
+ this, &DolphinMainWindow::openNewTab);
+ connect(view, &DolphinView::requestContextMenu,
+ this, &DolphinMainWindow::openContextMenu);
+ connect(view, &DolphinView::directoryLoadingStarted,
+ this, &DolphinMainWindow::enableStopAction);
+ connect(view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinMainWindow::disableStopAction);
+ connect(view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinMainWindow::slotDirectoryLoadingCompleted);
+ connect(view, &DolphinView::goBackRequested,
+ this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goBack));
+ connect(view, &DolphinView::goForwardRequested,
+ this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::goForward));
+ connect(view, &DolphinView::urlActivated,
+ this, &DolphinMainWindow::handleUrl);