X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b1448a0c32135153ca0b20dff8be901d87e129a5..4660ea3a48822a08bcfd8c518a168c344885bb65:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index a4dbb6f34..7117c09ba 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -217,6 +217,7 @@ DolphinMainWindow::DolphinMainWindow() : toggleSplitView(); } updateEditActions(); + updatePasteAction(); updateViewActions(); updateGoActions(); @@ -356,6 +357,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url) if (view) { view->setUrl(url); updateEditActions(); + updatePasteAction(); updateViewActions(); updateGoActions(); setUrlAsCaption(url); @@ -481,6 +483,8 @@ void DolphinMainWindow::openNewTab(const KUrl& url) m_viewTab.append(viewTab); actionCollection()->action("close_tab")->setEnabled(true); + actionCollection()->action("activate_prev_tab")->setEnabled(true); + actionCollection()->action("activate_next_tab")->setEnabled(true); // Provide a split view, if the startup settings are set this way if (GeneralSettings::splitView()) { @@ -677,6 +681,13 @@ void DolphinMainWindow::readProperties(const KConfigGroup& group) Q_ASSERT(cont); } + // The right view must be activated before the URL is set. Changing + // the URL in the right view will emit the right URL navigator's + // urlChanged(KUrl) signal, which is connected to the changeUrl(KUrl) + // slot. That slot will change the URL in the left view if it is still + // active. See https://bugs.kde.org/show_bug.cgi?id=330047. + setActiveViewContainer(cont); + cont->setUrl(secondaryUrl); const bool editable = group.readEntry(tabProperty("Secondary Editable", i), false); cont->urlNavigator()->setUrlEditable(editable); @@ -1148,6 +1159,8 @@ void DolphinMainWindow::closeTab(int index) if (m_viewTab.count() == 1) { m_tabBar->removeTab(0); actionCollection()->action("close_tab")->setEnabled(false); + actionCollection()->action("activate_prev_tab")->setEnabled(false); + actionCollection()->action("activate_next_tab")->setEnabled(false); } else { m_tabBar->blockSignals(false); } @@ -1444,6 +1457,7 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain updateHistory(); updateEditActions(); + updatePasteAction(); updateViewActions(); updateGoActions(); @@ -1627,11 +1641,13 @@ void DolphinMainWindow::setupActions() KAction* activateNextTab = actionCollection()->addAction("activate_next_tab"); activateNextTab->setText(i18nc("@action:inmenu", "Activate Next Tab")); + activateNextTab->setEnabled(false); connect(activateNextTab, SIGNAL(triggered()), SLOT(activateNextTab())); activateNextTab->setShortcuts(QApplication::isRightToLeft() ? prevTabKeys : nextTabKeys); KAction* activatePrevTab = actionCollection()->addAction("activate_prev_tab"); activatePrevTab->setText(i18nc("@action:inmenu", "Activate Previous Tab")); + activatePrevTab->setEnabled(false); connect(activatePrevTab, SIGNAL(triggered()), SLOT(activatePrevTab())); activatePrevTab->setShortcuts(QApplication::isRightToLeft() ? nextTabKeys : prevTabKeys); @@ -1804,7 +1820,6 @@ void DolphinMainWindow::updateEditActions() deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash); cutAction->setEnabled(capabilities.supportsMoving()); } - updatePasteAction(); } void DolphinMainWindow::updateViewActions()