Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37856090
en ru br
ALT Linux repos
S:5.27.8-alt1

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


--- 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;
 };
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin