Skip to content

Commit

Permalink
fix: [disc] some hint issue.
Browse files Browse the repository at this point in the history
Log: fix issue that error info is not correct.

Bug: https://pms.uniontech.com/bug-view-220713.html
  • Loading branch information
itsXuSt authored and Johnson-zs committed Sep 21, 2023
1 parent 5071c53 commit 9e015a5
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,26 +312,26 @@ void ComputerController::mountDevice(quint64 winId, const QString &id, const QSt

ComputerUtils::setCursorState(true);
DevMngIns->mountBlockDevAsync(id, {}, [=](bool ok, const DFMMOUNT::OperationErrorInfo &err, const QString &mpt) {
bool isOpticalDevice = id.contains(QRegularExpression("/sr[0-9]*$"));
if (ok || isOpticalDevice) {
QUrl u = isOpticalDevice ? ComputerUtils::makeBurnUrl(id) : ComputerUtils::makeLocalUrl(mpt);

if (isOpticalDevice)
this->waitUDisks2DataReady(id);

ComputerItemWatcherInstance->insertUrlMapper(id, u);
if (!shellId.isEmpty())
ComputerItemWatcherInstance->insertUrlMapper(shellId, QUrl::fromLocalFile(mpt));

cdTo(id, u, winId, act);
} else {
if (!ok) {
if (err.code == DFMMOUNT::DeviceError::kUDisksErrorNotAuthorizedDismissed) {
ComputerUtils::setCursorState();
return;
}
qInfo() << "mount device failed: " << id << err.message << err.code;
DialogManagerInstance->showErrorDialogWhenOperateDeviceFailed(DFMBASE_NAMESPACE::DialogManager::kMount, err);
return;
}

bool isOpticalDevice = id.contains(QRegularExpression("/sr[0-9]*$"));
if (isOpticalDevice)
this->waitUDisks2DataReady(id);

QUrl u = isOpticalDevice ? ComputerUtils::makeBurnUrl(id) : ComputerUtils::makeLocalUrl(mpt);
ComputerItemWatcherInstance->insertUrlMapper(id, u);
if (!shellId.isEmpty())
ComputerItemWatcherInstance->insertUrlMapper(shellId, QUrl::fromLocalFile(mpt));

cdTo(id, u, winId, act);
ComputerUtils::setCursorState();
});
}
Expand Down

0 comments on commit 9e015a5

Please sign in to comment.