[system/kio-snapshot] kioworker: kioworker/subvolume: fix stat for snapshot path

Bharadwaj Raju <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9de4d6095e1afaca1ba628cf97ec97cec657d295 by Bharadwaj Raju.
Committed on 14/08/2026 at 18:02.
Pushed by bharadwaj-raju into branch 'master'.

kioworker/subvolume: fix stat for snapshot path

M  +2    -10   kioworker/subvolumesnapshots.cpp

https://invent.kde.org/system/kio-snapshot/-/commit/9de4d6095e1afaca1ba628cf97ec97cec657d295

diff --git a/kioworker/subvolumesnapshots.cpp b/kioworker/subvolumesnapshots.cpp
index 35ec7af..06ccd2d 100644
--- a/kioworker/subvolumesnapshots.cpp
+++ b/kioworker/subvolumesnapshots.cpp
@@ -28,9 +28,6 @@
 
 KIO::WorkerResult SnapshotProtocol::listDirForSubvolume(const SnapshotUrl &url)
 {
-    qCDebug(KIO_SNAPSHOT) << "url" << url << "url.host" << url.host() << "subvolume" << url.subvolumeId() << "snapshotId" << url.snapshotId() << "actualPath"
-                          << url.actualPath();
-
     const QString fsRoot = url.fsRoot();
 
     if (!url.subvolumeId().has_value()) {
@@ -78,10 +75,6 @@ KIO::WorkerResult SnapshotProtocol::listDirForSubvolume(const SnapshotUrl &url)
         entry.fastInsert(KIO::UDSEntry::UDS_CREATION_TIME, snapshot.snapshotted.toSecsSinceEpoch());
         entry.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, QT_STAT_DIR);
         entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, "inode/directory"_L1);
-        // QUrl targetUrl = url;
-        // targetUrl.setPath(QDir::cleanPath("/%1/%2/"_L1.arg(QString::number(url.subvolumeId().value())).arg(QString::number(snapshot.subvolumeId))));
-        // entry.fastInsert(KIO::UDSEntry::UDS_TARGET_URL, targetUrl.toString(QUrl::FullyEncoded));
-        qCDebug(KIO_SNAPSHOT) << entry;
         udsList << entry;
     }
     listEntries(udsList);
@@ -111,12 +104,11 @@ KIO::WorkerResult SnapshotProtocol::statForSubvolume(const SnapshotUrl &url)
     qulonglong subvolumeId = url.subvolumeId().value();
     const QString fsRoot = url.fsRoot();
 
-    if (url.snapshotId().has_value() && !url.actualPath().isEmpty()) {
-        qCDebug(KIO_SNAPSHOT()) << "forwarding stat...";
+    if (url.snapshotId().has_value() && url.actualPath() != "/"_L1) {
         return KIO::ForwardingWorkerBase::stat(url);
     }
 
-    if (url.snapshotId().has_value() && url.actualPath().isEmpty()) {
+    if (url.snapshotId().has_value() && url.actualPath() == "/"_L1) {
         qulonglong snapshotId = url.snapshotId().value();
 
         BtrfsSnapshots::SubvolumeSnapshot snapshotInfo;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.