Skip to content

Commit

Permalink
fix: Unable to drag and move files to desktop trash icon
Browse files Browse the repository at this point in the history
Use the candrop attribute to retrieve and judge the flags when modifying the drop

Log: Unable to drag and move files to desktop trash icon
Bug: https://pms.uniontech.com/bug-view-257727.html
  • Loading branch information
liyigang1 committed Jul 2, 2024
1 parent d973ed8 commit 8404244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ Qt::ItemFlags FileInfoModel::flags(const QModelIndex &index) const
if (file->canAttributes(CanableInfoType::kCanRename))
flags |= Qt::ItemIsEditable;

if (file->isAttributes(OptInfoType::kIsWritable))
// use can drop attribute,if error modify the fileinfo candrop attribute
if (file->canAttributes(CanableInfoType::kCanDrop))
flags |= Qt::ItemIsDropEnabled;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,10 @@ Qt::ItemFlags FileViewModel::flags(const QModelIndex &index) const
if (index.data(kItemFileCanRenameRole).toBool())
flags |= Qt::ItemIsEditable;

if (index.data(kItemFileIsWritableRole).toBool())
if (index.data(kItemFileCanDropRole).toBool())
flags |= Qt::ItemIsDropEnabled;

// use can drop attribute,if error modify the fileinfo candrop attribute
if (index.data(kItemFileCanDragRole).toBool())
flags |= Qt::ItemIsDragEnabled;

Expand Down

0 comments on commit 8404244

Please sign in to comment.