]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't compute size for non-local urls
authorMéven Car <meven@kde.org>
Wed, 9 Aug 2023 17:03:40 +0000 (19:03 +0200)
committerMéven Car <meven.car@kdemail.net>
Sun, 13 Aug 2023 08:44:24 +0000 (08:44 +0000)
Hide progressInfo for listDir job on the non-recursize path.

BUG: 472912

src/kitemviews/kfileitemmodelrolesupdater.cpp

index bd4bd7e519b8f99d80259d9e785a965912f14ea8..09894f13ddabc10cfa07cbb62d992c82bb68eb8a 100644 (file)
@@ -1268,7 +1268,11 @@ bool KFileItemModelRolesUpdater::applyResolvedRoles(int index, ResolveHint hint)
 
 void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &item, int index)
 {
 
 void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &item, int index)
 {
-    if (ContentDisplaySettings::directorySizeCount() || item.isSlow() || !item.isLocalFile()) {
+    if (!item.isLocalFile()) {
+        return;
+    }
+
+    if (ContentDisplaySettings::directorySizeCount() || item.isSlow()) {
         // fastpath no recursion necessary
 
         auto data = m_model->data(index);
         // fastpath no recursion necessary
 
         auto data = m_model->data(index);
@@ -1291,7 +1295,7 @@ void KFileItemModelRolesUpdater::startDirectorySizeCounting(const KFileItem &ite
         m_model->setData(index, data);
         connect(m_model, &KFileItemModel::itemsChanged, this, &KFileItemModelRolesUpdater::slotItemsChanged);
 
         m_model->setData(index, data);
         connect(m_model, &KFileItemModel::itemsChanged, this, &KFileItemModelRolesUpdater::slotItemsChanged);
 
-        auto listJob = KIO::listDir(url);
+        auto listJob = KIO::listDir(url, KIO::HideProgressInfo);
         QObject::connect(listJob, &KIO::ListJob::entries, this, [this, index](const KJob * /*job*/, const KIO::UDSEntryList &list) {
             auto data = m_model->data(index);
             int origCount = data.value("count").toInt();
         QObject::connect(listJob, &KIO::ListJob::entries, this, [this, index](const KJob * /*job*/, const KIO::UDSEntryList &list) {
             auto data = m_model->data(index);
             int origCount = data.value("count").toInt();