Handle empty VolumeIdentifier in MTP devices.

Issue #1397
This commit is contained in:
Craig Drummond
2018-10-23 21:23:17 +01:00
parent 6eaabc7dc0
commit 3ce8ef2aff
2 changed files with 7 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
19. Change toolbar colours if palette changes.
20. Add another qt5ct palette work-around.
21. Don't stop library scan just because of failure in 1 directory.
22. Handle empty VolumeIdentifier in MTP devices.
2.3.2
-----

View File

@@ -580,6 +580,12 @@ void MtpConnection::updateStorage()
LIBMTP_devicestorage_struct *s=device->storage;
while (s) {
QString volumeIdentifier=QString::fromUtf8(s->VolumeIdentifier);
if (volumeIdentifier.isEmpty()) {
volumeIdentifier=QString::fromUtf8(s->StorageDescription);
}
if (volumeIdentifier.isEmpty()) {
volumeIdentifier="ID:"+QString::number(s->id);
}
QList<Storage>::Iterator it=storage.begin();
QList<Storage>::Iterator end=storage.end();
for ( ;it!=end; ++it) {