diff options
| author | Elvis Angelaccio <[email protected]> | 2020-11-10 00:05:27 +0100 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2020-11-10 00:05:27 +0100 |
| commit | 6719072837f30c1822768da65e6ea222e987e32f (patch) | |
| tree | b61a3c588561946e9d462e23379d44fbdeed185b /src/panels | |
| parent | e5d137b81debbbfe51c18d16d361fd28a3448416 (diff) | |
| parent | 63f4981fe01d88b2ef1b27e0577d7f5d4c8cc485 (diff) | |
Merge branch 'release/20.12'
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placesitemlistwidget.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/panels/places/placesitemlistwidget.cpp b/src/panels/places/placesitemlistwidget.cpp index 745a6ae1b..38bc13438 100644 --- a/src/panels/places/placesitemlistwidget.cpp +++ b/src/panels/places/placesitemlistwidget.cpp @@ -12,6 +12,8 @@ #include <KColorScheme> #include <KIO/FileSystemFreeSpaceJob> +#include <Solid/Device> +#include <Solid/NetworkShare> #define CAPACITYBAR_HEIGHT 2 #define CAPACITYBAR_MARGIN 2 @@ -41,12 +43,19 @@ QPalette::ColorRole PlacesItemListWidget::normalTextColorRole() const void PlacesItemListWidget::updateCapacityBar() { - const bool isDevice = !data().value("udi").toString().isEmpty(); - const QUrl url = data().value("url").toUrl(); - if (!(isDevice && url.isLocalFile())) { + const QString udi = data().value("udi").toString(); + if (udi.isEmpty()) { resetCapacityBar(); return; } + const Solid::Device device = Solid::Device(udi); + if (device.isDeviceInterface(Solid::DeviceInterface::NetworkShare) + || device.isDeviceInterface(Solid::DeviceInterface::OpticalDrive) + || device.isDeviceInterface(Solid::DeviceInterface::OpticalDisc)) { + resetCapacityBar(); + return; + } + const QUrl url = data().value("url").toUrl(); if (m_freeSpaceInfo.job || !m_freeSpaceInfo.lastUpdated.hasExpired()) { // Job running or cache is still valid. |
