]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge remote-tracking branch 'origin/KDE/4.11'
authorFrank Reininghaus <frank78ac@googlemail.com>
Sat, 26 Oct 2013 07:30:18 +0000 (09:30 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sat, 26 Oct 2013 07:30:18 +0000 (09:30 +0200)
1  2 
src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp

index d8973053c1ab13bbd96c8aeec1cd8b36cc488cd2,9da73f96e4f39f0162e23576e0bfd8503c4f0652..0804f4be9330033130a60f900fc2628fbf550070
@@@ -36,7 -36,6 +36,7 @@@
  #include "views/dolphinremoteencoding.h"
  #include "views/draganddrophelper.h"
  #include "views/viewproperties.h"
 +#include "views/dolphinnewfilemenuobserver.h"
  
  #ifndef Q_OS_WIN
  #include "panels/terminal/terminalpanel.h"
@@@ -128,9 -127,6 +128,9 @@@ DolphinMainWindow::DolphinMainWindow() 
      ViewTab& viewTab = m_viewTab[m_tabIndex];
      viewTab.wasActive = true; // The first opened tab is automatically active
  
 +    connect(&DolphinNewFileMenuObserver::instance(), SIGNAL(errorMessage(QString)),
 +            this, SLOT(showErrorMessage(QString)));
 +
      KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
      undoManager->setUiInterface(new UndoUiInterface());
  
@@@ -271,12 -267,12 +271,12 @@@ void DolphinMainWindow::openDirectories
  
      // Open each directory inside a new tab. If the "split view" option has been enabled,
      // always show two directories within one tab.
 -    QList<KUrl>::const_iterator it = urlsToOpen.begin();
 -    while (it != urlsToOpen.end()) {
 +    QList<KUrl>::const_iterator it = urlsToOpen.constBegin();
 +    while (it != urlsToOpen.constEnd()) {
          openNewTab(*it);
          ++it;
  
 -        if (hasSplitView && (it != urlsToOpen.end())) {
 +        if (hasSplitView && (it != urlsToOpen.constEnd())) {
              const int tabIndex = m_viewTab.count() - 1;
              m_viewTab[tabIndex].secondaryView->setUrl(*it);
              ++it;
@@@ -1421,6 -1417,19 +1421,19 @@@ void DolphinMainWindow::slotPanelErrorM
      activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
  }
  
+ void DolphinMainWindow::slotPlaceActivated(const KUrl& url)
+ {
+     DolphinViewContainer* view = activeViewContainer();
+     if (view->url() == url) {
+         // We can end up here if the user clicked a device in the Places Panel
+         // which had been unmounted earlier, see https://bugs.kde.org/show_bug.cgi?id=161385.
+         reloadView();
+     } else {
+         changeUrl(url);
+     }
+ }
  void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
  {
      Q_ASSERT(viewContainer);
@@@ -1472,7 -1481,7 +1485,7 @@@ DolphinViewContainer* DolphinMainWindow
  void DolphinMainWindow::setupActions()
  {
      // setup 'File' menu
 -    m_newFileMenu = new DolphinNewFileMenu(this);
 +    m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this);
      KMenu* menu = m_newFileMenu->menu();
      menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
      menu->setIcon(KIcon("document-new"));
@@@ -1753,7 -1762,7 +1766,7 @@@ void DolphinMainWindow::setupDockWidget
  
      addDockWidget(Qt::LeftDockWidgetArea, placesDock);
      connect(placesPanel, SIGNAL(placeActivated(KUrl)),
-             this, SLOT(changeUrl(KUrl)));
+             this, SLOT(slotPlaceActivated(KUrl)));
      connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
              this, SLOT(openNewTab(KUrl)));
      connect(placesPanel, SIGNAL(errorMessage(QString)),
index dc51f85f066f3a1c08a55c583177f0aa7ac94a79,e7c571294be20f9ae13681be58a1de1f36762e62..cc26198a0f4f333bbae4078c641fcbe5fcb6feea
@@@ -372,10 -372,6 +372,6 @@@ void DolphinViewContainer::setUrl(cons
  {
      if (newUrl != m_urlNavigator->locationUrl()) {
          m_urlNavigator->setLocationUrl(newUrl);
-     } else if (m_view->itemsCount() == 0) {
-         // Maybe a previously unmounted device has been mounted again.
-         // Let's reload the view to be safe (see https://bugs.kde.org/show_bug.cgi?id=161385).
-         m_view->reload();
      }
  
      #ifdef KActivities_FOUND
@@@ -512,7 -508,8 +508,7 @@@ void DolphinViewContainer::showItemInfo
      if (item.isNull()) {
          m_statusBar->resetToDefaultText();
      } else {
 -        const QString text = item.isDir() ? item.text() : item.getStatusBarInfo();
 -        m_statusBar->setText(text);
 +        m_statusBar->setText(item.getStatusBarInfo());
      }
  }