Group :: Graphical desktop/KDE
RPM: plasma5-kinfocenter
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: alt-mark-usb-drives.patch
Download
Download
--- a/Modules/devinfo/soldevicetypes.cpp
+++ b/Modules/devinfo/soldevicetypes.cpp
@@ -136,6 +136,7 @@ SolStorageDevice::SolStorageDevice(QTree
{
deviceTypeHolder = Solid::DeviceInterface::StorageDrive;
setDefaultDeviceText();
+ setDefaultDeviceIcon();
if (c == CREATECHILDREN) {
createDeviceChildren<SolVolumeDevice>(this,
@@ -196,6 +197,27 @@ void SolStorageDevice::setDefaultDeviceT
setDeviceText(deviceText);
}
+void SolStorageDevice::setDefaultDeviceIcon()
+{
+ QString str_icon(QStringLiteral("drive-harddisk"));
+
+ const Solid::StorageDrive *stodev = interface<const Solid::StorageDrive>();
+ if (!stodev) { return; }
+
+ switch (stodev->bus()) {
+ case Solid::StorageDrive::Usb:
+ str_icon = QStringLiteral("drive-removable-media-usb");
+ break;
+ default:
+ break;
+ }
+
+ QIcon dev_icon = QIcon::fromTheme(str_icon);
+ if( !dev_icon.isNull() ) {
+ setDeviceIcon(dev_icon);
+ }
+}
+
QVListLayout *SolStorageDevice::infoPanelLayout()
{
QStringList labels;
--- a/Modules/devinfo/soldevicetypes.h
+++ b/Modules/devinfo/soldevicetypes.h
@@ -54,6 +54,7 @@ public:
private:
void setDefaultDeviceText() override;
+ void setDefaultDeviceIcon() override;
void setDefaultListing(const Solid::DeviceInterface::Type &) override;
};