dndEventDelay (Re: kdelibs splitting: April iteration)

David Faure faure at kde.org
Wed Apr 4 06:35:00 UTC 2012


On Tuesday 03 April 2012 16:16:16 Stephen Kelly wrote:
> Changing KGlobalSettings::dndEventDelay() to 
> QApplication::startDragDistance() should simply be one of our todo items, 
> and we should simply change of them at once in all of kdelibs in the 
> frameworks branch.

Yes.

> I do find it an odd change though, because dndEventDelay 
> sounds like it's related to time (I haven't looked at its docs), and
> startDragDistance seems to relate to distance. At least, porting probably
> can't be done blindly.

KGlobalSettings::dndEventDelay() has always been misnamed.
Proof:

1) KDE4 implementation of it:
 return g.readEntry("StartDragDist", QApplication::startDragDistance());

2) Typical usage:

kio/kfile/kurlcombobox.cpp: 408:         (event->pos() - d-
>m_dragPoint).manhattanLength() > KGlobalSettings::dndEventDelay()) {

plasma/widgets/scrollwidget.cpp: 725:                 if (qAbs(dx) > 
KGlobalSettings::dndEventDelay())

etc.

It's pretty clear that it's both implemented, and used as a distance, so 
porting to QApplication::startDragDistance [and making this configurable via 
QPA or similar at some point] is actually a bug fix.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list