From a7a250104700b2af4afa697fb696ba372396035b Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Tue, 30 Jun 2020 00:11:30 +0200 Subject: [PATCH] Show new size if SD card replaced with different one Close #78 --- drivelistmodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivelistmodel.cpp b/drivelistmodel.cpp index 28ccef5..6dd42a2 100644 --- a/drivelistmodel.cpp +++ b/drivelistmodel.cpp @@ -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); } }