Skip to content

Commit

Permalink
fix: [menu] Can not delete file in some dir.
Browse files Browse the repository at this point in the history
1. The symlink is mount at '/data/',so can not delete it.
2. clean the '/data/' path.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-256393.html
  • Loading branch information
GongHeng2017 committed May 24, 2024
1 parent cfa0708 commit 8e36285
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ bool SendToMenuScene::triggered(QAction *action)
const QString &linkName = FileUtils::nonExistSymlinkFileName(localUrl, QUrl::fromLocalFile(QDir::currentPath()));
QString linkPath { QFileDialog::getSaveFileName(nullptr, QObject::tr("Create symlink"), linkName) };
if (!linkPath.isEmpty()) {
const QString &bindPath = FileUtils::bindPathTransform(localUrl.path(), false);
const QUrl &sourceUrl = QUrl::fromLocalFile(bindPath);
dpfSignalDispatcher->publish(GlobalEventType::kCreateSymlink,
d->windowId,
d->focusFile,
sourceUrl,
QUrl::fromLocalFile(linkPath),
true,
false);
Expand All @@ -210,7 +212,9 @@ bool SendToMenuScene::triggered(QAction *action)
for (const QUrl &url : urlsTrans) {
QString linkName = FileUtils::nonExistSymlinkFileName(url, QUrl::fromLocalFile(desktopPath));
QUrl linkUrl = QUrl::fromLocalFile(desktopPath + "/" + linkName);
dpfSignalDispatcher->publish(GlobalEventType::kCreateSymlink, d->windowId, url, linkUrl, false, true);
const QString &bindPath = FileUtils::bindPathTransform(url.path(), false);
const QUrl &sourceUrl = QUrl::fromLocalFile(bindPath);
dpfSignalDispatcher->publish(GlobalEventType::kCreateSymlink, d->windowId, sourceUrl, linkUrl, false, true);
}
return true;
} else if (actId == ActionID::kSendToBluetooth) {
Expand Down

0 comments on commit 8e36285

Please sign in to comment.