Commit a6dafae4 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

fwupd: make refreshing async too

So we don't block on it.
parent 5e48cd43
...@@ -299,6 +299,15 @@ static void fwupd_client_get_remotes_cb (GObject */*source*/, GAsyncResult *res, ...@@ -299,6 +299,15 @@ static void fwupd_client_get_remotes_cb (GObject */*source*/, GAsyncResult *res,
helper->handleError(error); helper->handleError(error);
} }
static void fwupd_client_refresh_remote_cb (GObject */*source*/, GAsyncResult *res, gpointer user_data)
{
FwupdBackend *helper = (FwupdBackend *) user_data;
g_autoptr(GError) error = nullptr;
fwupd_client_refresh_remote_finish(helper->client, res, &error);
if (error)
helper->handleError(error);
}
void FwupdBackend::setRemotes(GPtrArray *remotes) void FwupdBackend::setRemotes(GPtrArray *remotes)
{ {
for(uint i = 0; remotes && i < remotes->len; i++) for(uint i = 0; remotes && i < remotes->len; i++)
...@@ -310,9 +319,7 @@ void FwupdBackend::setRemotes(GPtrArray *remotes) ...@@ -310,9 +319,7 @@ void FwupdBackend::setRemotes(GPtrArray *remotes)
if (fwupd_remote_get_kind(remote) == FWUPD_REMOTE_KIND_LOCAL) if (fwupd_remote_get_kind(remote) == FWUPD_REMOTE_KIND_LOCAL)
continue; continue;
g_autoptr(GError) error = nullptr; fwupd_client_refresh_remote_async(client, remote, m_cancellable, fwupd_client_refresh_remote_cb, this);
fwupd_client_refresh_remote(client, remote, m_cancellable, &error);
handleError(error);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment