X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/70cd04df40b152fd7a448964b9f9ca4948291eb3..c5d9791ad392efffa19108c3ce7a4e6a67453a09:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 0804f4be9..847301434 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -31,7 +31,6 @@ #include "panels/information/informationpanel.h" #include "settings/dolphinsettingsdialog.h" #include "statusbar/dolphinstatusbar.h" -#include "views/dolphinview.h" #include "views/dolphinviewactionhandler.h" #include "views/dolphinremoteencoding.h" #include "views/draganddrophelper.h" @@ -248,20 +247,8 @@ void DolphinMainWindow::openDirectories(const QList& dirs) return; } - // dirs could contain URLs that actually point to archives or other files. - // Replace them by URLs we can open where possible and filter the rest out. - QList urlsToOpen; - foreach (const KUrl& rawUrl, dirs) { - const KFileItem& item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, rawUrl); - item.determineMimeType(); - const KUrl& url = DolphinView::openItemAsFolderUrl(item); - if (!url.isEmpty()) { - urlsToOpen.append(url); - } - } - - if (urlsToOpen.count() == 1) { - m_activeViewContainer->setUrl(urlsToOpen.first()); + if (dirs.count() == 1) { + m_activeViewContainer->setUrl(dirs.first()); return; } @@ -271,12 +258,12 @@ void DolphinMainWindow::openDirectories(const QList& dirs) // 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.constBegin(); - while (it != urlsToOpen.constEnd()) { + QList::const_iterator it = dirs.constBegin(); + while (it != dirs.constEnd()) { openNewTab(*it); ++it; - if (hasSplitView && (it != urlsToOpen.constEnd())) { + if (hasSplitView && (it != dirs.constEnd())) { const int tabIndex = m_viewTab.count() - 1; m_viewTab[tabIndex].secondaryView->setUrl(*it); ++it; @@ -690,6 +677,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);