]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge remote-tracking branch 'origin/Applications/18.08'
authorJaime Torres Amate <jtamate@gmail.com>
Sat, 6 Oct 2018 08:32:29 +0000 (10:32 +0200)
committerJaime Torres Amate <jtamate@gmail.com>
Sat, 6 Oct 2018 08:32:29 +0000 (10:32 +0200)
merge https://phabricator.kde.org/D15371

1  2 
src/dolphinmainwindow.cpp

index bdc9452ee19d2870b19b4a6a14f11f718ec3ace1,3e3803d68e36e2f99b633bae6491d54d2e9e2005..8c76fe7809cd0eece4545ca175115b620574db36
@@@ -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 <KAuthorized>
  #include <KConfig>
  #include <KFileItemListProperties>
 -#include <KFilePlacesModel>
  #include <KHelpMenu>
  #include <KIO/JobUiDelegate>
  #include <KIO/OpenFileManagerWindowJob>
@@@ -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<void(DolphinMainWindow::*)()>(&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);
              infoPanel, &InformationPanel::setSelection);
      connect(this, &DolphinMainWindow::requestItemInfo,
              infoPanel, &InformationPanel::requestDelayedItemInfo);
 +#endif
  
      // Setup "Folders"
      DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders"));
      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();