Commit dbec0146 authored by Aaron J. Seigo's avatar Aaron J. Seigo
Browse files

apparently something (bad) changed in QGraphicsView and now dragMoveEvent gets...

apparently something (bad) changed in QGraphicsView and now dragMoveEvent gets called repeatedly with the same pos

this made people confused about br#261443 as it was supposed to be fixed (it was) but a different issue entirely
had cropped up in the meantime. *sigh*

BUG:261443
parent e6c99554
......@@ -877,8 +877,8 @@ void AbstractTaskItem::setBackgroundFadeAlpha(qreal progress)
bool AbstractTaskItem::shouldIgnoreDragEvent(QGraphicsSceneDragDropEvent *event)
{
if (event->mimeData()->hasFormat(TaskManager::Task::mimetype()) ||
event->mimeData()->hasFormat(TaskManager::Task::groupMimetype())) {
if (event->mimeData()->hasFormat(TaskManager::Task::mimetype()) ||
event->mimeData()->hasFormat(TaskManager::Task::groupMimetype())) {
return true;
}
......@@ -889,13 +889,15 @@ bool AbstractTaskItem::shouldIgnoreDragEvent(QGraphicsSceneDragDropEvent *event)
if (!uris.isEmpty()) {
foreach (const QUrl &uri, uris) {
KUrl url(uri);
if (url.isLocalFile()) {
const QString path = url.toLocalFile();
QFileInfo info(path);
if (info.isDir() || !info.isExecutable()) {
return false;
break;
}
if (!url.isLocalFile()) {
return false;
}
const QString path = url.toLocalFile();
QFileInfo info(path);
if (info.isDir() || !info.isExecutable()) {
return false;
break;
}
}
......@@ -916,19 +918,19 @@ void AbstractTaskItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
event->accept();
if (!m_activateTimerId) {
m_activateTimerId = startTimer(500);
m_activateTimerId = startTimer(250);
m_oldDragPos = event->pos();
}
}
void AbstractTaskItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
{
Q_UNUSED(event);
// restart the timer so that activate() is only called after the mouse
// stops moving
if (m_activateTimerId) {
if (m_activateTimerId && event->pos() != m_oldDragPos) {
m_oldDragPos = event->pos();
killTimer(m_activateTimerId);
m_activateTimerId = startTimer(500);
m_activateTimerId = startTimer(250);
}
}
......
......@@ -260,6 +260,7 @@ private:
bool m_showText : 1;
bool m_layoutAnimationLock : 1;
bool m_firstGeometryUpdate : 1;
QPointF m_oldDragPos;
};
#endif
Supports Markdown
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