Skip to content

Commit

Permalink
fix: [mount/optical] cannot mount a erased bd-re disc.
Browse files Browse the repository at this point in the history
When the empty disc type is bd-re, DeviceUtils::isBlankOpticalDis returns false

Bug: https://pms.uniontech.com/bug-view-268053.html
  • Loading branch information
zhangxianting committed Aug 27, 2024
1 parent aad21d8 commit 7df7118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dfm-base/base/device/deviceutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ bool DeviceUtils::isWorkingOpticalDiscId(const QString &id)

bool DeviceUtils::isBlankOpticalDisc(const QString &id)
{
// for dvd+rw/dvd-rw disc, erase operation only overwrite some blocks which used to present filesystem,
// for dvd+rw/dvd-rw/bd-re disc, erase operation only overwrite some blocks which used to present filesystem,
// so the blank field is still false even if it can be write datas from the beginning,
auto &&map = DevProxyMng->queryBlockInfo(id);
bool isBlank { map[kOpticalBlank].toBool() };
auto mediaType { static_cast<MediaType>(map[kOpticalMediaType].toUInt()) };
if (mediaType == MediaType::kDVD_PLUS_RW || mediaType == MediaType::kDVD_RW)
if (mediaType == MediaType::kDVD_PLUS_RW || mediaType == MediaType::kDVD_RW || mediaType == MediaType::kBD_RE)
isBlank |= map[kSizeTotal].toULongLong() == map[kSizeFree].toULongLong();

return isBlank;
Expand Down

0 comments on commit 7df7118

Please sign in to comment.