diff --git a/qt/pool.cpp b/qt/pool.cpp index 4da656ba..f59253ff 100644 --- a/qt/pool.cpp +++ b/qt/pool.cpp @@ -64,9 +64,19 @@ Pool::~Pool() // empty. needed for the scoped pointer for the private pointer } -bool Pool::load() +bool AppStream::Pool::load() { - return as_pool_load (d->m_pool, NULL, NULL); + return load(nullptr); +} + +bool Pool::load(QString* strerror) +{ + g_autoptr(GError) error = nullptr; + bool ret = as_pool_load (d->m_pool, NULL, &error); + if (!ret && error) { + *strerror = QString::fromUtf8(error->message); + } + return ret; } void Pool::clear() diff --git a/qt/pool.h b/qt/pool.h index 248949b1..144b3288 100644 --- a/qt/pool.h +++ b/qt/pool.h @@ -76,6 +76,13 @@ Q_OBJECT */ bool load(); + /** + * \return true on success. False on failure + * + * In case of failure, @p error will be initialized with the error message + */ + bool load(QString* error); + /** * Remove all software component information from the pool. */