From 7aa73ea4adbdb2414aa978845b2d0eba8a912d80 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 15 Jun 2021 18:50:22 +0200 Subject: [PATCH] qt: Expose setter and getter for Pool's cache location property --- qt/pool.cpp | 10 ++++++++++ qt/pool.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/qt/pool.cpp b/qt/pool.cpp index 17563b4ed..5ada19c86 100644 --- a/qt/pool.cpp +++ b/qt/pool.cpp @@ -183,3 +183,13 @@ void Pool::setCacheFlags(uint flags) { as_pool_set_cache_flags (d->pool, (AsCacheFlags) flags); } + +QString AppStream::Pool::cacheLocation() const +{ + return QString::fromUtf8(as_pool_get_cache_location(d->pool)); +} + +void Pool::setCacheLocation(const QString &location) +{ + as_pool_set_cache_location(d->pool, qPrintable(location)); +} diff --git a/qt/pool.h b/qt/pool.h index 437d84f4a..001e07f28 100644 --- a/qt/pool.h +++ b/qt/pool.h @@ -126,6 +126,9 @@ Q_OBJECT uint cacheFlags() const; void setCacheFlags(uint flags); + void setCacheLocation(const QString &path); + QString cacheLocation() const; + private: Q_DISABLE_COPY(Pool); QScopedPointer d;