[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars/widgets
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2008-08-25 14:34:46
Message-ID: 1219674886.068751.3665.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 852210 by harris:

Final fix for bug #169744.  A dragged item is now dropped in the correct 
place.

BUG: 169744
CCMAIL: kstars-devel@kde.org



 M  +7 -2      draglistbox.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/widgets/draglistbox.cpp #852209:852210
@@ -72,8 +72,13 @@
         //need to insert the item, because FieldPool already has a persistent Ignore item.
         if ( !( text == i18n("Ignore" ) && QString(evt->source()->objectName()) == "FieldList" &&
                 evt->source() != this )) {
-            int i = indexAt( evt->pos() ).row();
-            insertItem( i, text );
+	    QListWidgetItem *lwi = itemAt( evt->pos() );
+	    if ( lwi == 0 && evt->pos().y() > visualItemRect(item(count()-1)).bottom() ) {
+		addItem( text );
+	    } else {
+		int i = row( itemAt( evt->pos() ) );
+		insertItem( i, text );
+	    } 
         }
 
         //Remove an item dragged from FieldList to FieldPool.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic