*/
#include "dolphinpart.h"
-#include "dolphinviewactionhandler.h"
-#include "dolphinsortfilterproxymodel.h"
-#include "dolphinview.h"
-#include "dolphinmodel.h"
-#include "dolphinnewmenuobserver.h"
-#include "dolphinremoteencoding.h"
#include <kfileitemlistproperties.h>
#include <konq_operations.h>
#include <kio/netaccess.h>
#include <ktoolinvocation.h>
#include <kauthorized.h>
-#include <knewmenu.h>
+#include <knewfilemenu.h>
#include <kmenu.h>
#include <kinputdialog.h>
#include "settings/dolphinsettings.h"
+#include "views/dolphinview.h"
+#include "views/dolphinviewactionhandler.h"
+#include "views/dolphinsortfilterproxymodel.h"
+#include "views/dolphinmodel.h"
+#include "views/dolphinnewmenuobserver.h"
+#include "views/dolphinremoteencoding.h"
#include <QActionGroup>
#include <QApplication>
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)),
{
// Edit menu
- m_newMenu = new KNewMenu(actionCollection(), widget(), "new_menu");
+ 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()));
void DolphinPart::slotItemTriggered(const KFileItem& item)
{
KParts::OpenUrlArguments args;
- args.setMimeType(item.mimetype());
+ // Forget about the known mimetype if a target URL is used.
+ // Testcase: network:/ with a item (mimetype "inode/some-foo-service") pointing to a http URL (html)
+ if (item.targetUrl() == item.url()) {
+ args.setMimeType(item.mimetype());
+ }
// Ideally, konqueror should be changed to not require trustedSource for directory views,
// since the idea was not to need BrowserArguments for non-browser stuff...
// 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;
QList<QAction *> editActions;
-
+ editActions += m_view->versionControlActions(m_view->selectedItems());
editActions += customActions;
if (!_item.isNull()) { // only for context menu on one or more items
}
}
-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)
void DolphinPart::updateNewMenu()
{
- // As requested by KNewMenu :
- m_newMenu->slotCheckUpToDate();
+ // As requested by KNewFileMenu :
+ m_newMenu->checkUpToDate();
m_newMenu->setViewShowsHiddenFiles(m_view->showHiddenFiles());
// And set the files that the menu apply on :
m_newMenu->setPopupFiles(url());
m_newMenu->createDirectory();
}
+void DolphinPart::setFilesToSelect(const KUrl::List& files)
+{
+ m_view->markUrlsAsSelected(files);
+}
+
#include "dolphinpart.moc"