]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/draganddrophelper.cpp
Respect Shift- and Control-key for the rubberband selection
[dolphin.git] / src / views / draganddrophelper.cpp
index 9708415f0a057953b32aeaa7d5b24e3b662de5bc..bc1361b9a729ff335b202f9de818246e4c1247c2 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by Peter Penz <peter.penz@gmx.at>                  *
+ *   Copyright (C) 2007 by Peter Penz <peter.penz19@gmail.com>             *
  *   Copyright (C) 2007 by David Faure <faure@kde.org>                     *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 
 #include "draganddrophelper.h"
 
-#include <kdirmodel.h>
-#include <kfileitem.h>
-#include <kicon.h>
-#include <klocale.h>
+#include <KDirModel>
+#include <KFileItem>
+#include <KIcon>
+#include <KLocale>
 #include <konq_operations.h>
 
 #include "views/dolphiniconsview.h"
@@ -62,11 +62,11 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
     const QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
     if (!indexes.isEmpty()) {
         QMimeData *data = itemView->model()->mimeData(indexes);
-        if (data == 0) {
+        if (!data) {
             return;
         }
 
-        if (dolphinViewController != 0) {
+        if (dolphinViewController) {
             dolphinViewController->requestToolTipHiding();
         }
 
@@ -83,7 +83,7 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
 
 bool DragAndDropHelper::isDragSource(QAbstractItemView* itemView) const
 {
-    return (m_dragSource != 0) && (m_dragSource == itemView);
+    return m_dragSource && (m_dragSource == itemView);
 }
 
 void DragAndDropHelper::dropUrls(const KFileItem& destItem,
@@ -99,7 +99,7 @@ void DragAndDropHelper::dropUrls(const KFileItem& destItem,
         QString remoteDBusClient = mimeData->data("application/x-kde-dndextract");
         QDBusMessage message = QDBusMessage::createMethodCall(remoteDBusClient, "/DndExtract",
                                                               "org.kde.DndExtract", "extractSelectedFilesTo");
-        message.setArguments(QVariantList() << destination.path());
+        message.setArguments(QVariantList() << destination.pathOrUrl());
         QDBusConnection::sessionBus().call(message);
     } else {
         const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());