/***************************************************************************
- * Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at> *
+ * Copyright (C) 2008 by Peter Penz <peter.penz19@gmail.com> *
* Copyright (C) 2010 by Christian Muehlhaeuser <muesli@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
#include "placespanel.h"
-#include "dolphin_generalsettings.h"
-#include "draganddrophelper.h"
-#include <kfileitem.h>
+#include <KFileItem>
#include <konq_operations.h>
-#include "settings/dolphinsettings.h"
+#include <views/draganddrophelper.h>
PlacesPanel::PlacesPanel(QWidget* parent) :
KFilePlacesView(parent),
m_mouseButtons(Qt::NoButton)
{
setDropOnPlaceEnabled(true);
- connect(this, SIGNAL(urlsDropped(const KUrl&, QDropEvent*, QWidget*)),
- this, SLOT(slotUrlsDropped(const KUrl&, QDropEvent*, QWidget*)));
- connect(this, SIGNAL(urlChanged(const KUrl&)),
- this, SLOT(emitExtendedUrlChangedSignal(const KUrl&)));
+ connect(this, SIGNAL(urlsDropped(KUrl,QDropEvent*,QWidget*)),
+ this, SLOT(slotUrlsDropped(KUrl,QDropEvent*,QWidget*)));
+ connect(this, SIGNAL(urlChanged(KUrl)),
+ this, SLOT(emitExtendedUrlChangedSignal(KUrl)));
}
PlacesPanel::~PlacesPanel()
KFilePlacesView::mousePressEvent(event);
}
-void PlacesPanel::rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end)
-{
- Q_UNUSED(parent);
-
- const QModelIndexList indexes = selectedIndexes();
- if (!indexes.isEmpty()) {
- const int selectedRow = indexes.first().row();
- if ((start >= selectedRow) && (end <= selectedRow)) {
- // The currently selected item is about to be removed, reset view to home URL
- const KUrl homeUrl = DolphinSettings::instance().generalSettings()->homeUrl();
- setUrl(homeUrl);
- emit urlChanged(homeUrl, Qt::NoButton);
- }
- }
-}
-
void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent)
{
- DragAndDropHelper::instance().dropUrls(KFileItem(), dest, event, parent);
+ Q_UNUSED(parent);
+ const KFileItem destItem(KFileItem::Unknown, KFileItem::Unknown, dest);
+ DragAndDropHelper::dropUrls(destItem, event);
}
void PlacesPanel::emitExtendedUrlChangedSignal(const KUrl& url)