]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Prevents warnings
authorMéven Car <meven29@gmail.com>
Fri, 29 May 2020 17:35:02 +0000 (19:35 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 31 May 2020 21:19:09 +0000 (21:19 +0000)
Warnings such as :
kf5.kio.core: Invalid URL: QUrl("")

It happened for instance with recentlyused:/ ioslave

src/views/dolphinview.cpp

index fc036bce29823c748c371ec26210aaff175269fe..c827f5768ed1a11699cc05f9964324f15e83a0e1 100644 (file)
@@ -1522,6 +1522,10 @@ void DolphinView::calculateItemCount(int& fileCount,
 
     bool countFileSize = true;
 
+    if (!m_model->rootItem().url().isValid()) {
+        return;
+    }
+
     // In case we have a precomputed value
     const auto job = KIO::statDetails(m_model->rootItem().url(), KIO::StatJob::SourceSide, KIO::StatRecursiveSize, KIO::HideProgressInfo);
     job->exec();