mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
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:
parent
35408f2c52
commit
76462f3261
1 changed files with 4 additions and 4 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue