┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/draganddrophelper.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-11-26 18:51:04 +0000
committerPeter Penz <[email protected]>2010-11-26 18:51:04 +0000
commit55a9aa18d2ddd2688eeb59d962ed60067bbd9f6c (patch)
tree499f929a204d2419808e64be54d6ce65852f1c5f /src/views/draganddrophelper.cpp
parentc520572f5d15a3c3bf83956eb1a19316a6b2952b (diff)
DragAndDropHelper::isMimeTypeSupported() returns always true in the meantime - remove it
svn path=/trunk/KDE/kdebase/apps/; revision=1201101
Diffstat (limited to 'src/views/draganddrophelper.cpp')
-rw-r--r--src/views/draganddrophelper.cpp28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp
index 8ab96d368..9708415f0 100644
--- a/src/views/draganddrophelper.cpp
+++ b/src/views/draganddrophelper.cpp
@@ -47,14 +47,6 @@ DragAndDropHelper& DragAndDropHelper::instance()
return s_dragAndDropHelper->instance;
}
-bool DragAndDropHelper::isMimeDataSupported(const QMimeData* mimeData) const
-{
- // We support everything, cf KonqOperations::doDrop which can save any data.
- //return mimeData->hasUrls() || mimeData->hasFormat("application/x-kde-dndextract");
- Q_UNUSED(mimeData);
- return true;
-}
-
void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
Qt::DropActions supportedActions,
DolphinViewController* dolphinViewController)
@@ -129,14 +121,14 @@ DragAndDropHelper::DragAndDropHelper()
QPixmap DragAndDropHelper::createDragPixmap(QAbstractItemView* itemView) const
{
- const QModelIndexList selectedIndexes = itemView->selectionModel()->selectedIndexes();
+ const QModelIndexList selectedIndexes = itemView->selectionModel()->selectedIndexes();
Q_ASSERT(!selectedIndexes.isEmpty());
-
+
QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(itemView->model());
KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel());
-
+
const int itemCount = selectedIndexes.count();
-
+
// If more than one item is dragged, align the items inside a
// rectangular grid. The maximum grid size is limited to 5 x 5 items.
int xCount = 3;
@@ -148,11 +140,11 @@ QPixmap DragAndDropHelper::createDragPixmap(QAbstractItemView* itemView) const
xCount = 4;
size = KIconLoader::SizeSmallMedium;
}
-
+
if (itemCount < xCount) {
xCount = itemCount;
}
-
+
int yCount = itemCount / xCount;
if (itemCount % xCount != 0) {
++yCount;
@@ -161,10 +153,10 @@ QPixmap DragAndDropHelper::createDragPixmap(QAbstractItemView* itemView) const
yCount = xCount;
}
- // Draw the selected items into the grid cells
+ // Draw the selected items into the grid cells
QPixmap dragPixmap(xCount * size + xCount - 1, yCount * size + yCount - 1);
dragPixmap.fill(Qt::transparent);
-
+
QPainter painter(&dragPixmap);
int x = 0;
int y = 0;
@@ -173,7 +165,7 @@ QPixmap DragAndDropHelper::createDragPixmap(QAbstractItemView* itemView) const
const KFileItem item = dirModel->itemForIndex(index);
const QPixmap pixmap = item.pixmap(size, size);
painter.drawPixmap(x, y, pixmap);
-
+
x += size + 1;
if (x >= dragPixmap.width()) {
x = 0;
@@ -183,7 +175,7 @@ QPixmap DragAndDropHelper::createDragPixmap(QAbstractItemView* itemView) const
break;
}
}
-
+
return dragPixmap;
}