mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-30 00:55:33 +01:00
Workaround udisks2 mountpoint issue with Qt 6
This commit is contained in:
parent
8110035d71
commit
38cc39f23d
@ -370,13 +370,21 @@ Udisks2Lister::PartitionData Udisks2Lister::ReadPartitionData(const QDBusObjectP
|
|||||||
result.uuid = block.idUUID();
|
result.uuid = block.idUUID();
|
||||||
result.capacity = drive.size();
|
result.capacity = drive.size();
|
||||||
|
|
||||||
if (!result.label.isEmpty())
|
if (result.label.isEmpty()) {
|
||||||
result.friendly_name = result.label;
|
|
||||||
else
|
|
||||||
result.friendly_name = result.model + " " + result.uuid;
|
result.friendly_name = result.model + " " + result.uuid;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result.friendly_name = result.label;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &p : filesystem.mountPoints())
|
for (const QByteArray &p : filesystem.mountPoints()) {
|
||||||
result.mount_paths.push_back(p);
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // Workaround a bytearray to string conversion issue with Qt 6
|
||||||
|
QString mountpoint = QByteArray(p.data(), strlen(p.data()));
|
||||||
|
#else
|
||||||
|
QString mountpoint = p;
|
||||||
|
#endif
|
||||||
|
result.mount_paths.push_back(mountpoint);
|
||||||
|
}
|
||||||
|
|
||||||
result.free_space = Utilities::FileSystemFreeSpace(result.mount_paths.at(0));
|
result.free_space = Utilities::FileSystemFreeSpace(result.mount_paths.at(0));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user