Commit 9a5e9be0 authored by Laurent Montel's avatar Laurent Montel 😁

Don't loop twice here

Reviewers: hein

Reviewed By: hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8515
parent bf0a2b81
......@@ -760,11 +760,12 @@ void FolderModel::setDragHotSpotScrollOffset(int x, int y)
QPoint FolderModel::dragCursorOffset(int row)
{
if (!m_dragImages.contains(row)) {
DragImage *image = m_dragImages.value(row);
if (!image) {
return QPoint(-1, -1);
}
return m_dragImages.value(row)->cursorOffset;
return image->cursorOffset;
}
void FolderModel::addDragImage(QDrag *drag, int x, int y)
......
......@@ -141,11 +141,7 @@ void Positioner::setPositions(const QStringList &positions)
int Positioner::map(int row) const
{
if (m_enabled && m_folderModel) {
if (m_proxyToSource.contains(row)) {
return m_proxyToSource.value(row);
} else {
return -1;
}
return m_proxyToSource.value(row, -1);
}
return row;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment