X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a5cf21ff06aff44cde563eaceae3c6cef452ee48..c8d8556950005dfd96ebdb41d2f43ad90356367c:/src/panels/places/placespanel.cpp diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 1ca9bf59a..6f522fad2 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Peter Penz * + * Copyright (C) 2008 by Peter Penz * * Copyright (C) 2010 by Christian Muehlhaeuser * * * * This program is free software; you can redistribute it and/or modify * @@ -20,21 +20,19 @@ #include "placespanel.h" -#include "dolphin_generalsettings.h" -#include +#include #include -#include "settings/dolphinsettings.h" -#include "views/draganddrophelper.h" +#include 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() @@ -47,25 +45,11 @@ void PlacesPanel::mousePressEvent(QMouseEvent* event) 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)