Use drive-removable-media-usb icon for USB devices.

This commit is contained in:
Andrius Štikonas 2018-12-06 01:23:27 +00:00
parent 80f5a32dc0
commit d4f3ac62ae
1 changed files with 8 additions and 1 deletions

View File

@ -183,9 +183,16 @@ Device* SfdiskBackend::scanDevice(const QString& deviceNode)
name = kname.output();
}
ExternalCommand transport(QStringLiteral("lsblk"), {QStringLiteral("--nodeps"), QStringLiteral("--noheadings"), QStringLiteral("--output"), QStringLiteral("tran"),
deviceNode});
QString icon;
if (transport.run(-1) && transport.exitCode() == 0)
if (transport.output().trimmed() == QStringLiteral("usb"))
icon = QStringLiteral("drive-removable-media-usb");
Log(Log::Level::information) << xi18nc("@info:status", "Device found: %1", name);
d = new DiskDevice(name, deviceNode, 255, 63, deviceSize / logicalSectorSize / 255 / 63, logicalSectorSize);
d = new DiskDevice(name, deviceNode, 255, 63, deviceSize / logicalSectorSize / 255 / 63, logicalSectorSize, icon);
}
if ( d )