]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placespanel.cpp
Fix style-issues in items when not using Oxygen
[dolphin.git] / src / panels / places / placespanel.cpp
index 0da932154bd0437a3af2376f5d07e3c3cbd25f60..6f522fad2ea44d916c3cc985bad43fbabad85d07 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   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()
@@ -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)