From: Frank Reininghaus Date: Sat, 26 Oct 2013 07:30:18 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/KDE/4.11' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/70cd04df40b152fd7a448964b9f9ca4948291eb3?hp=-c Merge remote-tracking branch 'origin/KDE/4.11' --- 70cd04df40b152fd7a448964b9f9ca4948291eb3 diff --combined src/dolphinmainwindow.cpp index d8973053c,9da73f96e..0804f4be9 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -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::const_iterator it = urlsToOpen.begin(); - while (it != urlsToOpen.end()) { + QList::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)), diff --combined src/dolphinviewcontainer.cpp index dc51f85f0,e7c571294..cc26198a0 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@@ -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()); } }