Fix a compiler warning about KFileItem::acceptsDrops() being deprecated by

checking the item flags for the hovered index instead.

svn path=/trunk/KDE/kdebase/apps/; revision=819948
This commit is contained in:
Fredrik Höglund 2008-06-12 17:42:11 +00:00
parent 35408f2c52
commit 76462f3261

View file

@ -73,6 +73,7 @@ FolderView::FolderView(QObject *parent, const QVariantList &args)
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 @@ void FolderView::dropEvent(QGraphicsSceneDragDropEvent *event)
// 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()) {