Show new size if SD card replaced with different one

Close #78
This commit is contained in:
Floris Bos 2020-06-30 00:11:30 +02:00
parent 7506d5b35a
commit a7a2501047

View file

@ -81,10 +81,10 @@ void DriveListModel::refreshDriveList()
continue;
#endif
QString device = QString::fromStdString(i.device);
drivesInNewList.insert(device);
QString deviceNamePlusSize = QString::fromStdString(i.device)+":"+QString::number(i.size);
drivesInNewList.insert(deviceNamePlusSize);
if (!_drivelist.contains(device))
if (!_drivelist.contains(deviceNamePlusSize))
{
// Found new drive
if (!changes)
@ -93,7 +93,7 @@ void DriveListModel::refreshDriveList()
changes = true;
}
_drivelist[device] = new DriveListItem(device, QString::fromStdString(i.description), i.size, i.isUSB, i.isSCSI, mountpoints, this);
_drivelist[deviceNamePlusSize] = new DriveListItem(QString::fromStdString(i.device), QString::fromStdString(i.description), i.size, i.isUSB, i.isSCSI, mountpoints, this);
}
}