#include "statusbar/dolphinstatusbar.h"
#include "views/dolphinviewactionhandler.h"
#include "views/dolphinremoteencoding.h"
+#include "views/draganddrophelper.h"
#include "views/viewproperties.h"
#ifndef Q_OS_WIN
const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
if (!urls.isEmpty() && tab != -1) {
const ViewTab& viewTab = m_viewTab[tab];
- const KUrl destPath = viewTab.isPrimaryViewActive ? viewTab.primaryView->url() : viewTab.secondaryView->url();
- Q_UNUSED(destPath);
- //DragAndDropHelper::instance().dropUrls(KFileItem(), destPath, event, m_tabBar);
+ const DolphinView* view = viewTab.isPrimaryViewActive ? viewTab.primaryView->view()
+ : viewTab.secondaryView->view();
+ DragAndDropHelper::dropUrls(view->rootItem(), event);
}
}
emit selectionChanged(selectedItems());
}
-void DolphinView::dropUrls(const KFileItem& destItem,
- const KUrl& destPath,
- QDropEvent* event)
-{
- Q_UNUSED(destItem);
- Q_UNUSED(destPath);
- markPastedUrlsAsSelected(event->mimeData());
- //DragAndDropHelper::instance().dropUrls(destItem, destPath, event, this);
-}
-
void DolphinView::updateSorting(DolphinView::Sorting sorting)
{
ViewProperties props(url());
KFileItem DolphinView::rootItem() const
{
- return m_dirLister->rootItem();
+ KFileItem item = m_dirLister->rootItem();
+ if (item.isNull()) {
+ // The directory has not been loaded yet
+ item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, url());
+ }
+ return item;
}
void DolphinView::observeCreatedItem(const KUrl& url)
bool hasSelection() const;
/**
- * Returns the root item which represents the current URL. Note that the returned
- * item can be null (KFileItem::isNull() will return true) in case that the directory
- * has not been loaded.
+ * Returns the root item which represents the current URL.
*/
KFileItem rootItem() const;
*/
void emitSelectionChangedSignal();
- /**
- * Drops dragged URLs to the destination path \a destPath. If
- * the URLs are dropped above an item inside the destination path,
- * the item is indicated by \a destItem.
- */
- void dropUrls(const KFileItem& destItem,
- const KUrl& destPath,
- QDropEvent* event);
-
/**
* Updates the view properties of the current URL to the
* sorting given by \a sorting.