Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Unable to drag files to disc #2045

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dfm-base/interfaces/fileinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ bool DFMBASE_NAMESPACE::FileInfoPrivate::canDrop()

if (!q->isAttributes(OptInfoType::kIsSymLink)) {
const bool isDesktop = q->nameOf(NameInfoType::kMimeTypeName) == Global::Mime::kTypeAppXDesktop;
return q->isAttributes(OptInfoType::kIsDir) || isDesktop;
return (q->isAttributes(OptInfoType::kIsDir) && q->isAttributes(OptInfoType::kIsWritable)) || isDesktop;
}

FileInfoPointer info = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool DragDropHelper::dragMove(QDragMoveEvent *event)
return true;

QUrl toUrl = hoverFileInfo->urlOf(UrlInfoType::kUrl);
if (!checkTargetEnable(toUrl) || !hoverFileInfo->isAttributes(OptInfoType::kIsWritable)) {
if (!checkTargetEnable(toUrl) || !hoverFileInfo->canAttributes(CanableInfoType::kCanDrop)) {
event->ignore();
currentHoverIndexUrl = toUrl;
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,19 @@ bool MasteredMediaFileInfo::canAttributes(const CanableInfoType type) const

Qt::DropActions MasteredMediaFileInfo::supportedOfAttributes(const SupportedType type) const
{
if (type == SupportType::kDrop)
if (type == SupportType::kDrop) {
if (!OpticalHelper::isBurnEnabled())
return Qt::IgnoreAction;

if (isAttributes(OptInfoType::kIsWritable)) {
return Qt::CopyAction | Qt::MoveAction | Qt::LinkAction;
}

if (d->canDrop()) {
return Qt::CopyAction | Qt::MoveAction;
}
return Qt::IgnoreAction;
}
return ProxyFileInfo::supportedOfAttributes(type);
}

Expand Down
Loading