]> cloud.milkyroute.net Git - dolphin.git/commitdiff
SpaceInfoObserver: don't instantiate MountPointObserver if m_url is empty
authorMéven Car <meven@kde.org>
Thu, 9 Jan 2025 14:29:20 +0000 (15:29 +0100)
committerMéven Car <meven@kde.org>
Fri, 10 Jan 2025 09:29:30 +0000 (10:29 +0100)
This prevents "Invalid URL:" on dolphin start.

src/statusbar/spaceinfoobserver.cpp

index 243e2141bc8f4c315e18c42ef0d976b1edbd668b..ae56137d11aa57a47366db50d5a9748986a5281e 100644 (file)
@@ -15,10 +15,9 @@ SpaceInfoObserver::SpaceInfoObserver(const QUrl &url, QObject *parent)
     , m_dataSize(0)
     , m_dataAvailable(0)
 {
-    m_mountPointObserver = MountPointObserver::observerForUrl(url);
-    m_mountPointObserver->ref();
-    connect(m_mountPointObserver, &MountPointObserver::spaceInfoChanged, this, &SpaceInfoObserver::spaceInfoChanged);
-    m_mountPointObserver->update();
+    if (!url.isEmpty()) {
+        setUrl(url);
+    }
 }
 
 SpaceInfoObserver::~SpaceInfoObserver()