[pim/kdepim-runtime] resources/dav/resource: add ListItemsForCollection method to davGroupwareResource

Noham Devillers <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9e0ffa42f319e88f5b5eb831063e70eefa08301f by Noham Devillers.
Committed on 22/07/2026 at 09:57.
Pushed by ndevillers into branch 'master'.

add ListItemsForCollection method to davGroupwareResource

M  +16   -0    resources/dav/resource/davgroupwareresource.cpp
M  +1    -0    resources/dav/resource/davgroupwareresource.h

https://invent.kde.org/pim/kdepim-runtime/-/commit/9e0ffa42f319e88f5b5eb831063e70eefa08301f

diff --git a/resources/dav/resource/davgroupwareresource.cpp b/resources/dav/resource/davgroupwareresource.cpp
index 62e794afe..80f53cc2a 100644
--- a/resources/dav/resource/davgroupwareresource.cpp
+++ b/resources/dav/resource/davgroupwareresource.cpp
@@ -1918,6 +1918,22 @@ void DavGroupwareResource::retryAfterFailure(const QString &errorMessage)
     setTemporaryOffline(settings()->refreshInterval() <= 0 ? 300 : settings()->refreshInterval() * 60);
 }
 
+void DavGroupwareResource::listItemsForCollection(const KDAV::DavUrl &davUrl, const Akonadi::Collection &collection)
+{
+    auto listJob = new KDAV::DavItemsListJob(davUrl, mDavItemCache.value(collection.remoteId())->eTagCache());
+    if (settings()->limitSyncRange()) {
+        QDateTime start = settings()->getSyncRangeStart();
+        qCDebug(DAVRESOURCE_LOG) << "Start time for list job:" << start;
+        if (start.isValid()) {
+            listJob->setTimeRange(start.toString(QStringLiteral("yyyyMMddTHHMMssZ")), QString());
+        }
+    }
+    listJob->setProperty("collection", QVariant::fromValue(collection));
+    listJob->setContentMimeTypes(collection.contentMimeTypes());
+    connect(listJob, &KDAV::DavItemsListJob::result, this, &DavGroupwareResource::onRetrieveItemsFinished);
+    listJob->start();
+}
+
 /*static*/
 void DavGroupwareResource::setCollectionIcon(Akonadi::Collection &collection)
 {
diff --git a/resources/dav/resource/davgroupwareresource.h b/resources/dav/resource/davgroupwareresource.h
index f918deefc..52b654303 100644
--- a/resources/dav/resource/davgroupwareresource.h
+++ b/resources/dav/resource/davgroupwareresource.h
@@ -131,6 +131,7 @@ private:
 
     bool configurationIsValid();
     void retryAfterFailure(const QString &errorMessage);
+    void listItemsForCollection(const KDAV::DavUrl &davUrl, const Akonadi::Collection &collection);
 
     /**
      * Collections which only support one mime type have an icon indicating what they support.
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.