X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ad85be955bc34f9ed9aa69f4453f26f57bf85e04..7eeb8dba6aeba09aa3dfa7fa5f0b00840d4d8317:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index c8db1c1e1..519d05741 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -106,8 +106,6 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL this, SLOT(slotSelectionChanged(KFileItemList))); connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(slotRequestItemInfo(KFileItem))); - connect(m_view, SIGNAL(requestUrlChange(KUrl)), - this, SLOT(slotRequestUrlChange(KUrl))); connect(m_view, SIGNAL(modeChanged()), this, SIGNAL(viewModeChanged())); // relay signal connect(m_view, SIGNAL(redirection(KUrl, KUrl)), @@ -156,7 +154,8 @@ void DolphinPart::createActions() { // Edit menu - m_newMenu = new KNewFileMenu(actionCollection(), "new_menu", widget()); + m_newMenu = new KNewFileMenu(actionCollection(), "new_menu", this); + m_newMenu->setParentWidget(widget()); DolphinNewMenuObserver::instance().attach(m_newMenu); connect(m_newMenu->menu(), SIGNAL(aboutToShow()), this, SLOT(updateNewMenu())); @@ -385,8 +384,13 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, // TODO: We should change the signature of the slots (and signals) for being able // to tell for which items we want a popup. - const KFileItemList items = (m_view->selectedItems().count() ? m_view->selectedItems() - : KFileItemList() << item); + KFileItemList items; + if (m_view->selectedItems().isEmpty()) { + items.append(item); + } else { + items = m_view->selectedItems(); + } + KFileItemListProperties capabilities(items); KParts::BrowserExtension::ActionGroupMap actionGroups; @@ -455,16 +459,6 @@ void DolphinPart::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl) } } -void DolphinPart::slotRequestUrlChange(const KUrl& url) -{ - if (m_view->url() != url) { - // If the view URL is not equal to 'url', then an inner URL change has - // been done (e. g. by activating an existing column in the column view). - openUrl(url); - emit m_extension->openUrlNotify(); - } -} - //// void DolphinPartBrowserExtension::restoreState(QDataStream &stream) @@ -625,4 +619,9 @@ void DolphinPart::createDirectory() m_newMenu->createDirectory(); } +void DolphinPart::setFilesToSelect(const KUrl::List& files) +{ + m_view->markUrlsAsSelected(files); +} + #include "dolphinpart.moc"