]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Only show capacity bar for devices (has a udi).
authorChris Holland <zrenfire@gmail.com>
Fri, 1 Nov 2019 22:45:52 +0000 (18:45 -0400)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 4 Nov 2020 23:16:13 +0000 (23:16 +0000)
src/panels/places/placesitemlistwidget.cpp

index 4d88f8c55e9a216a14a8e671d939a6ce65a0d3dd..c494469014374146fa5bf86805c8e103e2349eb9 100644 (file)
@@ -43,8 +43,9 @@ QPalette::ColorRole PlacesItemListWidget::normalTextColorRole() const
 
 void PlacesItemListWidget::updateCapacityBar()
 {
+    const bool isDevice = !data().value("udi").toString().isEmpty();
     const QUrl url = data().value("url").toUrl();
-    if (url.isLocalFile()) {
+    if (isDevice && url.isLocalFile()) {
         const QString mountPointPath = url.toLocalFile();
         qDebug() << "url:" << mountPointPath;
         KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(mountPointPath);
@@ -57,12 +58,12 @@ void PlacesItemListWidget::updateCapacityBar()
             qDebug() << "    capacityBarRatio:" << m_capacityBarRatio << "(" << info.used() << "/" << info.size() << ")";
 
             // update();
-        } else {
-            resetCapacityBar();
+            return;
         }
-    } else {
-        resetCapacityBar();
     }
+
+    // else
+    resetCapacityBar();
 }
 
 void PlacesItemListWidget::resetCapacityBar()