From: Jaime Torres Amate Date: Sat, 6 Oct 2018 08:32:29 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/Applications/18.08' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b610ce5913ef3172f3cf15c0a1d93c255ea0da4f?hp=-c Merge remote-tracking branch 'origin/Applications/18.08' merge https://phabricator.kde.org/D15371 --- b610ce5913ef3172f3cf15c0a1d93c255ea0da4f diff --combined src/dolphinmainwindow.cpp index bdc9452ee,3e3803d68..8c76fe780 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -25,6 -25,7 +25,6 @@@ #include "dolphindockwidget.h" #include "dolphincontextmenu.h" #include "dolphinnewfilemenu.h" -#include "dolphinplacesmodelsingleton.h" #include "dolphinrecenttabsmenu.h" #include "dolphintabwidget.h" #include "dolphinviewcontainer.h" @@@ -48,6 -49,7 +48,6 @@@ #include #include #include -#include #include #include #include @@@ -135,7 -137,7 +135,7 @@@ DolphinMainWindow::DolphinMainWindow() connect(m_tabWidget, &DolphinTabWidget::tabCountChanged, this, &DolphinMainWindow::tabCountChanged); connect(m_tabWidget, &DolphinTabWidget::currentUrlChanged, - this, &DolphinMainWindow::setUrlAsCaption); + this, &DolphinMainWindow::updateWindowTitle); setCentralWidget(m_tabWidget); setupActions(); @@@ -590,7 -592,6 +590,7 @@@ void DolphinMainWindow::reloadView( { clearStatusBar(); m_activeViewContainer->reload(); + m_activeViewContainer->statusBar()->updateSpaceInfo(); } void DolphinMainWindow::stopLoading() @@@ -1000,9 -1001,46 +1000,9 @@@ void DolphinMainWindow::tabCountChanged actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); } -void DolphinMainWindow::setUrlAsCaption(const QUrl& url) +void DolphinMainWindow::updateWindowTitle() { - QString schemePrefix; - if (!url.isLocalFile()) { - schemePrefix.append(url.scheme() + " - "); - if (!url.host().isEmpty()) { - schemePrefix.append(url.host() + " - "); - } - } - - if (GeneralSettings::showFullPathInTitlebar()) { - const QString path = url.adjusted(QUrl::StripTrailingSlash).path(); - setWindowTitle(schemePrefix + path); - return; - } - - KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); - const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, url, 1, Qt::MatchExactly); - - if (!matchedPlaces.isEmpty()) { - setWindowTitle(placesModel->text(matchedPlaces.first())); - return; - } - - QString fileName = url.adjusted(QUrl::StripTrailingSlash).fileName(); - if (fileName.isEmpty()) { - fileName = '/'; - } - - if (m_activeViewContainer->isSearchModeEnabled()) { - if(m_activeViewContainer->currentSearchText().isEmpty()){ - setWindowTitle(i18n("Search")); - } else { - const auto searchText = i18n("Search for %1", m_activeViewContainer->currentSearchText()); - setWindowTitle(searchText); - } - return; - } - - setWindowTitle(schemePrefix + fileName); + setWindowTitle(m_activeViewContainer->caption()); } void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) @@@ -1041,7 -1079,7 +1041,7 @@@ void DolphinMainWindow::setupActions( QAction* newTab = actionCollection()->addAction(QStringLiteral("new_tab")); newTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-new"))); newTab->setText(i18nc("@action:inmenu File", "New Tab")); - actionCollection()->setDefaultShortcuts(newTab, {QKeySequence::AddTab}); + actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::SHIFT + Qt::Key_N}); connect(newTab, &QAction::triggered, this, static_cast(&DolphinMainWindow::openNewActivatedTab)); QAction* closeTab = KStandardAction::close( @@@ -1228,8 -1266,6 +1228,8 @@@ void DolphinMainWindow::setupDockWidget infoDock->setLocked(lock); infoDock->setObjectName(QStringLiteral("infoDock")); infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + +#ifdef HAVE_BALOO InformationPanel* infoPanel = new InformationPanel(infoDock); infoPanel->setCustomContextMenuActions({lockLayoutAction}); connect(infoPanel, &InformationPanel::urlActivated, this, &DolphinMainWindow::handleUrl); @@@ -1245,7 -1281,6 +1245,7 @@@ infoPanel, &InformationPanel::setSelection); connect(this, &DolphinMainWindow::requestItemInfo, infoPanel, &InformationPanel::requestDelayedItemInfo); +#endif // Setup "Folders" DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders")); @@@ -1342,9 -1377,7 +1342,9 @@@ panelsMenu->setDelayed(false); const KActionCollection* ac = actionCollection(); panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel"))); +#ifdef HAVE_BALOO panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel"))); +#endif panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel"))); panelsMenu->addAction(ac->action(QStringLiteral("show_terminal_panel"))); panelsMenu->addSeparator(); @@@ -1468,7 -1501,7 +1468,7 @@@ void DolphinMainWindow::refreshViews( const bool splitView = GeneralSettings::splitView(); m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView); updateSplitAction(); - setUrlAsCaption(activeViewContainer()->url()); + updateWindowTitle(); } emit settingsChanged();