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

List:       kde-commits
Subject:    KDE/kdebase/apps/plasma/applets/folderview
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2008-06-12 17:42:12
Message-ID: 1213292532.482547.22637.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 819948 by fredrik:

Fix a compiler warning about KFileItem::acceptsDrops() being deprecated by
checking the item flags for the hovered index instead.


 M  +4 -4      folderview.cpp  


--- trunk/KDE/kdebase/apps/plasma/applets/folderview/folderview.cpp #819947:819948
@@ -73,6 +73,7 @@
     resize(600, 400);
 
     m_dirModel = new KDirModel(this);
+    m_dirModel->setDropsAllowed(KDirModel::DropOnDirectory | KDirModel::DropOnLocalExecutable);
 
     m_model = new ProxyModel(this);
     m_model->setSourceModel(m_dirModel);
@@ -933,11 +934,10 @@
     // in the drag and drop operation, but since two QGraphicsItems can be part of the
     // same widget, we can't use that method here.
     KFileItem item;
-    if (m_hoveredIndex.isValid()) {
+    if (m_hoveredIndex.isValid() &&
+        (m_model->flags(m_hoveredIndex) & Qt::ItemIsDropEnabled))
+    {
         item = m_model->itemForIndex(m_hoveredIndex);
-        if (!item.acceptsDrops()) {
-            item = KFileItem();
-        }
     }
 
     if (!m_dragInProgress || !item.isNull()) {
[prev in list] [next in list] [prev in thread] [next in thread] 

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